diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Home.php b/workflow/engine/src/ProcessMaker/Services/Api/Home.php index 6ef85198b..5887546f7 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Home.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Home.php @@ -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}'."); + } + } }