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:
@@ -33,18 +33,23 @@ class User extends Api
|
||||
|
||||
/**
|
||||
* @url GET
|
||||
* @param string $filter
|
||||
* @param int $start
|
||||
* @param int $limit
|
||||
*/
|
||||
public function doGetUsers($filter = '', $start = null, $limit = null)
|
||||
public function index($filter = null, $lfilter = null, $rfilter = null, $start = null, $limit = null)
|
||||
{
|
||||
try {
|
||||
$user = new \ProcessMaker\BusinessModel\User();
|
||||
$response = $user->getUsers($filter, $start, $limit);
|
||||
return $response;
|
||||
$user->setFormatFieldNameInUppercase(false);
|
||||
|
||||
$arrayFilterData = array(
|
||||
"filter" => (!is_null($filter))? $filter : ((!is_null($lfilter))? $lfilter : ((!is_null($rfilter))? $rfilter : null)),
|
||||
"filterOption" => (!is_null($filter))? "" : ((!is_null($lfilter))? "LEFT" : ((!is_null($rfilter))? "RIGHT" : ""))
|
||||
);
|
||||
|
||||
$response = $user->getUsers($arrayFilterData, null, null, $start, $limit);
|
||||
|
||||
return $response["data"];
|
||||
} catch (\Exception $e) {
|
||||
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
|
||||
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +62,8 @@ class User extends Api
|
||||
{
|
||||
try {
|
||||
$user = new \ProcessMaker\BusinessModel\User();
|
||||
$user->setFormatFieldNameInUppercase(false);
|
||||
|
||||
$response = $user->getUser($usr_uid);
|
||||
return $response;
|
||||
} catch (\Exception $e) {
|
||||
@@ -131,3 +138,4 @@ class User extends Api
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user