diff --git a/workflow/engine/src/BusinessModel/ProcessPermissions.php b/workflow/engine/src/BusinessModel/ProcessPermissions.php index 2f24ac291..585a2f264 100644 --- a/workflow/engine/src/BusinessModel/ProcessPermissions.php +++ b/workflow/engine/src/BusinessModel/ProcessPermissions.php @@ -232,15 +232,21 @@ class ProcessPermissions $sObjectUID = ''; break; case 'DYNAFORM': - $this->validateDynUid($data['DYNAFORMS']); + if ($data['DYNAFORMS'] != '') { + $this->validateDynUid($data['DYNAFORMS']); + } $sObjectUID = $data['DYNAFORMS']; break; case 'INPUT': - $this->validateInpUid($data['INPUTS']); + if ($data['INPUTS'] != '') { + $this->validateInpUid($data['INPUTS']); + } $sObjectUID = $data['INPUTS']; break; case 'OUTPUT': - $this->validateOutUid($data['OUTPUTS']); + if ($data['OUTPUTS'] != '') { + $this->validateOutUid($data['OUTPUTS']); + } $sObjectUID = $data['OUTPUTS']; break; } @@ -417,6 +423,9 @@ class ProcessPermissions public function validateDynUid($dyn_uid) { $dyn_uid = trim($dyn_uid); + if ($dyn_uid == '') { + throw (new \Exception("The dynaform with dynaforms: '' does not exist.")); + } $oDynaform = new \Dynaform(); if (!($oDynaform->dynaformExists($dyn_uid))) { throw (new \Exception("The dynaform with dynaforms: '$dyn_uid' does not exist.")); @@ -436,6 +445,9 @@ class ProcessPermissions public function validateInpUid($inp_uid) { $inp_uid = trim($inp_uid); + if ($inp_uid == '') { + throw (new \Exception("The input with inputs: '' does not exist.")); + } $oInputDocument = new \InputDocument(); if (!($oInputDocument->InputExists($inp_uid))) { throw (new \Exception("The input with inputs: '$inp_uid' does not exist.")); @@ -455,6 +467,9 @@ class ProcessPermissions public function validateOutUid($out_uid) { $out_uid = trim($out_uid); + if ($out_uid == '') { + throw (new \Exception("The output with outputs: '' does not exist.")); + } $oOutputDocument = new \OutputDocument(); if (!($oOutputDocument->OutputExists($out_uid))) { throw (new \Exception("The output with outputs: '$out_uid' does not exist."));