PMCORE-2539

This commit is contained in:
Julio Cesar Laura Avendaño
2020-12-11 18:23:49 +00:00
parent 58c084bccc
commit 3fdae0b272
3 changed files with 121 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ use ProcessMaker\BusinessModel\Cases\Search;
use ProcessMaker\BusinessModel\Cases\Supervising;
use ProcessMaker\BusinessModel\Cases\Unassigned;
use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Process;
use ProcessMaker\Model\User;
use ProcessMaker\Services\Api;
use RBAC;
@@ -570,4 +571,31 @@ class Home extends Api
return $result;
}
/**
* Get all processes, paged optionally, can be sent a text to filter results by "PRO_TITLE"
*
* @url GET /processes
*
* @param string $text
* @param string $category
* @param int $offset
* @param int $limit
*
* @return array
*
* @throws Exception
*
* @access protected
* @class AccessControl {@permission PM_CASES}
*/
public function getProcesses($text = null, $category = null, $offset = null, $limit = null)
{
try {
$processes = Process::getProcessesForHome($text, $category, $offset, $limit);
return $processes;
} catch (Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
}