PM-3659 "Uso de interface lenta (assignment rules) cuando..." SOLVED
Issue:
Uso de interface lenta (assignment rules) cuando se tienen varios usuarios (40000)
Cause:
No se realizo de manera correcta el paginado de registros
Solution:
> Se a implementado los siguientes end-points:
GET /api/1.0/{workspace}/project/{prj_uid}/activity/{act_uid}/assignee/paged
GET /api/1.0/{workspace}/project/{prj_uid}/activity/{act_uid}/available-assignee/paged
GET /api/1.0/{workspace}/project/{prj_uid}/activity/{act_uid}/adhoc-assignee/paged
GET /api/1.0/{workspace}/project/{prj_uid}/activity/{act_uid}/adhoc-available-assignee/paged
Estos end-points aceptan los siguientes parametros:
/paged?filter={filter}&start={start}&limit={limit}&type={type}
/paged?lfilter={lfilter}&start={start}&limit={limit}&type={type}
/paged?rfilter={rfilter}&start={start}&limit={limit}&type={type}
Donde:
filter: Representa la busqueda de registros que contienen este valor
lfilter: Representa la busqueda de registros que empiezan con este valor
rfilter: Representa la busqueda de registros que terminan con este valor
type: Acepta los siguentes valores: "user", "group"
Ejemplo:
GET /api/1.0/{workspace}/project/{prj_uid}/activity/{act_uid}/assignee/paged?start=0&limit=3
<<<<< 200
{
"total": 15,
"start": 0,
"limit": 3,
"filter": "",
"data": [
{
"aas_uid": "60593768854492f8fa43aa2064326562",
"aas_name": "GROUP1 (2 Users)",
"aas_lastname": "",
"aas_username": "",
"aas_type": "group"
},
{
"aas_uid": "11886228656016c9329c898096916123",
"aas_name": "GROUP2 (1 User)",
"aas_lastname": "",
"aas_username": "",
"aas_type": "group"
},
{
"aas_uid": "52242914255f202805bd552031573543",
"aas_name": "user1",
"aas_lastname": "user1",
"aas_username": "user1",
"aas_type": "user"
}
]
}
> Se a mejorado los siguientes end-points:
GET /api/1.0/{workspace}/users?filter={filter}&start={start}&limit={limit}
GET /api/1.0/{workspace}/users?lfilter={lfilter}&start={start}&limit={limit}
GET /api/1.0/{workspace}/users?rfilter={rfilter}&start={start}&limit={limit}
GET /api/1.0/{workspace}/groups?filter={filter}&start={start}&limit={limit}
GET /api/1.0/{workspace}/groups?lfilter={lfilter}&start={start}&limit={limit}
GET /api/1.0/{workspace}/groups?rfilter={rfilter}&start={start}&limit={limit}
This commit is contained in:
@@ -211,22 +211,6 @@ class Step
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if doesn't exist the Task in table TASK
|
||||
*
|
||||
* @param string $taskUid Unique id of Task
|
||||
*
|
||||
* return void Throw exception if doesn't exist the Task in table TASK
|
||||
*/
|
||||
public function throwExceptionIfNotExistsTask($taskUid)
|
||||
{
|
||||
$task = new \Task();
|
||||
|
||||
if (!$task->taskExists($taskUid)) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_ACTIVITY_DOES_NOT_EXIST", array($this->arrayParamException["taskUid"], $taskUid)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify if doesn't exist the Process in table PROCESS
|
||||
*
|
||||
@@ -260,10 +244,12 @@ class Step
|
||||
unset($arrayData["STEP_UID"]);
|
||||
|
||||
//Verify data
|
||||
$this->throwExceptionIfNotExistsTask($taskUid);
|
||||
$task = new \ProcessMaker\BusinessModel\Task();
|
||||
|
||||
$this->throwExceptionIfNotExistsProcess($processUid);
|
||||
|
||||
$task->throwExceptionIfNotExistsTask($processUid, $taskUid, $this->arrayParamException["taskUid"]);
|
||||
|
||||
if (!isset($arrayData["STEP_TYPE_OBJ"])) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_UNDEFINED_VALUE_IS_REQUIRED", array($this->arrayParamException["stepTypeObj"])));
|
||||
}
|
||||
@@ -495,7 +481,9 @@ class Step
|
||||
$step->setArrayParamException($this->arrayParamException);
|
||||
|
||||
//Verify data
|
||||
$this->throwExceptionIfNotExistsTask($taskUid);
|
||||
$task = new \ProcessMaker\BusinessModel\Task();
|
||||
|
||||
$task->throwExceptionIfNotExistsTask("", $taskUid, $this->arrayParamException["taskUid"]);
|
||||
|
||||
//Get data
|
||||
$criteria = new \Criteria("workflow");
|
||||
@@ -638,7 +626,9 @@ class Step
|
||||
}
|
||||
|
||||
if ($stepUid == "") {
|
||||
$this->throwExceptionIfNotExistsTask($taskUid);
|
||||
$task = new \ProcessMaker\BusinessModel\Task();
|
||||
|
||||
$task->throwExceptionIfNotExistsTask("", $taskUid, $this->arrayParamException["taskUid"]);
|
||||
}
|
||||
|
||||
//Get data
|
||||
@@ -753,7 +743,9 @@ class Step
|
||||
}
|
||||
|
||||
if ($stepUid == "") {
|
||||
$this->throwExceptionIfNotExistsTask($taskUid);
|
||||
$task = new \ProcessMaker\BusinessModel\Task();
|
||||
|
||||
$task->throwExceptionIfNotExistsTask("", $taskUid, $this->arrayParamException["taskUid"]);
|
||||
}
|
||||
|
||||
//Get data
|
||||
@@ -937,10 +929,12 @@ class Step
|
||||
unset($arrayData["STEP_UID"]);
|
||||
|
||||
//Verify data
|
||||
$this->throwExceptionIfNotExistsTask($taskUid);
|
||||
$task = new \ProcessMaker\BusinessModel\Task();
|
||||
|
||||
$this->throwExceptionIfNotExistsProcess($processUid);
|
||||
|
||||
$task->throwExceptionIfNotExistsTask($processUid, $taskUid, $this->arrayParamException["taskUid"]);
|
||||
|
||||
if (!isset($arrayData["STEP_TYPE_OBJ"])) {
|
||||
throw new \Exception(\G::LoadTranslation("ID_UNDEFINED_VALUE_IS_REQUIRED", array($this->arrayParamException["stepTypeObj"])));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user