getParsedBody()->id ?? null; if (!$id) { throw new BadRequest(); } if (!$this->acl->checKScope(BpmnProcessEntity::ENTITY_TYPE, Table::ACTION_EDIT)) { throw new Forbidden(); } /** @var BpmnProcessService $service */ $service = $this->getRecordService(); $service->stopProcess($id); return true; } /** * @throws BadRequest * @throws Forbidden * @throws Error * @throws NotFound */ public function postActionReactivate(Request $request): bool { $id = $request->getParsedBody()->id ?? null; if (!$id) { throw new BadRequest(); } if (!$this->acl->checKScope(BpmnProcessEntity::ENTITY_TYPE, Table::ACTION_EDIT)) { throw new Forbidden(); } /** @var BpmnProcessService $service */ $service = $this->getRecordService(); $service->reactivateProcess($id); return true; } /** * @throws BadRequest * @throws Forbidden * @throws NotFound * @throws Error */ public function postActionRejectFlowNode(Request $request): bool { $id = $request->getParsedBody()->id ?? null; if (!$id) { throw new BadRequest(); } if (!$this->acl->checKScope(BpmnProcessEntity::ENTITY_TYPE, Table::ACTION_EDIT)) { throw new Forbidden(); } /** @var BpmnProcessService $service */ $service = $this->getRecordService(); $service->rejectFlowNode($id); return true; } /** * @throws BadRequest * @throws Forbidden * @throws Error * @throws NotFound */ public function postActionStartFlowFromElement(Request $request): bool { $processId = $request->getParsedBody()->processId ?? null; $elementId = $request->getParsedBody()->elementId ?? null; if (!$processId) { throw new BadRequest(); } if (!$elementId) { throw new BadRequest(); } if (!$this->acl->checKScope(BpmnProcessEntity::ENTITY_TYPE, Table::ACTION_EDIT)) { throw new Forbidden(); } /** @var BpmnProcessService $service */ $service = $this->getRecordService(); $service->startFlowFromElement($processId, $elementId); return true; } }