Merged in feature/PMCORE-2764 (pull request #7766)

PMCORE-2764

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Julio Cesar Laura Avendaño
2021-01-21 14:55:32 +00:00

View File

@@ -698,4 +698,35 @@ class Home extends Api
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
}
/**
* Get the process debug status
*
* @url GET /process-debug-status
*
* @param string $processUid
*
* @return bool
*
* @throws Exception
*
* @access protected
* @class AccessControl {@permission PM_CASES}
*/
public function getProcessDebugStatus($processUid)
{
try {
// Get the process requested
$process = Process::query()->select(['PRO_DEBUG'])->where('PRO_UID', '=', $processUid)->first();
if (!is_null($process)) {
return $process->PRO_DEBUG === 1;
}
} catch (Exception $e) {
throw new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage());
}
// If not exists the requested process throw an 404 error
if (is_null($process)) {
throw new RestException(404, "Process with Uid '{$processUid}'.");
}
}
}