HOR-3155
This commit is contained in:
@@ -90,5 +90,26 @@ class SubApplication extends BaseSubApplication
|
|||||||
throw($oError);
|
throw($oError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This function is relate to subprocess, verify is parent case had create a case
|
||||||
|
* This is relevant for SYNCHRONOUS subprocess
|
||||||
|
* @param string $appUid
|
||||||
|
* @param integer $delIndex
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public function isSubProcessWithCasePending($appUid, $delIndex){
|
||||||
|
$oCriteria = new Criteria('workflow');
|
||||||
|
$oCriteria->add(SubApplicationPeer::APP_PARENT, $appUid);
|
||||||
|
$oCriteria->add(SubApplicationPeer::DEL_INDEX_PARENT, $delIndex);
|
||||||
|
$oCriteria->add(SubApplicationPeer::SA_STATUS, 'ACTIVE');
|
||||||
|
$oDataset = SubApplicationPeer::doSelectRS($oCriteria);
|
||||||
|
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||||
|
|
||||||
|
if ($oDataset->next()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1095,6 +1095,12 @@ class Cases
|
|||||||
try {
|
try {
|
||||||
if (!$delIndex) {
|
if (!$delIndex) {
|
||||||
$delIndex = \AppDelegation::getCurrentIndex($applicationUid);
|
$delIndex = \AppDelegation::getCurrentIndex($applicationUid);
|
||||||
|
//Check if the next task is a subprocess SYNCHRONOUS with a thread Open
|
||||||
|
$subAppData = new \SubApplication();
|
||||||
|
$caseSubprocessPending = $subAppData->isSubProcessWithCasePending($applicationUid, $delIndex);
|
||||||
|
if ($caseSubprocessPending) {
|
||||||
|
throw (new \Exception(\G::LoadTranslation("ID_CASE_ALREADY_DERIVATED")));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
\G::LoadClass('wsBase');
|
\G::LoadClass('wsBase');
|
||||||
$ws = new \wsBase();
|
$ws = new \wsBase();
|
||||||
|
|||||||
Reference in New Issue
Block a user