diff --git a/workflow/engine/src/ProcessMaker/BusinessModel/Cases/InputDocument.php b/workflow/engine/src/ProcessMaker/BusinessModel/Cases/InputDocument.php index 454695576..fa1144c7f 100644 --- a/workflow/engine/src/ProcessMaker/BusinessModel/Cases/InputDocument.php +++ b/workflow/engine/src/ProcessMaker/BusinessModel/Cases/InputDocument.php @@ -3,6 +3,26 @@ namespace ProcessMaker\BusinessModel\Cases; class InputDocument { + /** + * Verify exists app_doc_uid in table APP_DOCUMENT + * + * @param string $applicationUid + * + * return void Throw exception + */ + private function throwExceptionIfNotExistsAppDocument($appDocumentUid) + { + try { + $appDocument = \AppDocumentPeer::retrieveByPK($appDocumentUid, 1); + + if (is_null($appDocument)) { + throw new \Exception(\G::LoadTranslation("ID_CASES_INPUT_DOES_NOT_EXIST", array($appDocumentUid))); + } + } catch (\Exception $e) { + throw $e; + } + } + /** * Check if the user has permissions * @@ -47,6 +67,9 @@ class InputDocument throw new \Exception(\G::LoadTranslation("ID_USER_NOT_HAVE_PERMISSION_DELETE_INPUT_DOCUMENT", array($userUid))); } + //verfiry exists $appDocumentUid + $this->throwExceptionIfNotExistsAppDocument($appDocumentUid); + //Verify data permission $flagPermission = 0;