Merged in paulis/processmaker/PM-4082-V6 (pull request #3223)

PM-4082
This commit is contained in:
Julio Cesar Laura Avendaño
2015-11-24 17:10:35 -04:00

View File

@@ -729,7 +729,7 @@ class Derivation
$elementDestType $elementDestType
); );
if($elementDestUid == "-1"){ if($elementDestUid == "-1" || count($arrayElement) == 0){
$arrayElement = $this->throwElementToEnd($elementOriginUid, $rouCondition); $arrayElement = $this->throwElementToEnd($elementOriginUid, $rouCondition);
} }
@@ -1063,9 +1063,18 @@ class Derivation
$this->case->closeAllDelegations( $currentDelegation['APP_UID'] ); $this->case->closeAllDelegations( $currentDelegation['APP_UID'] );
$this->case->closeAllThreads( $currentDelegation['APP_UID'] ); $this->case->closeAllThreads( $currentDelegation['APP_UID'] );
//I think we need to change the APP_STATUS to completed, //I think we need to change the APP_STATUS to completed,
if (isset($nextDel["TAS_UID_DUMMY"]) ) {
//BpmnEvent $taskDummy = TaskPeer::retrieveByPK($nextDel["TAS_UID_DUMMY"]);
$this->throwEventsBetweenElementOriginAndElementDest($currentDelegation["TAS_UID"], $nextDel["TAS_UID"], $appFields, $flagFirstIteration, true, $nextDel['ROU_CONDITION']); if (preg_match("/^(?:END-MESSAGE-EVENT|END-EMAIL-EVENT)$/", $taskDummy->getTasType())) {
//Throw Events
$this->throwEventsBetweenElementOriginAndElementDest($currentDelegation["TAS_UID"], $nextDel["TAS_UID_DUMMY"], $appFields, $flagFirstIteration, true);
} else {
$this->throwEventsBetweenElementOriginAndElementDest($currentDelegation["TAS_UID"], $nextDel["TAS_UID"], $appFields, $flagFirstIteration, true, $nextDel['ROU_CONDITION']);
}
} else {
//BpmnEvent
$this->throwEventsBetweenElementOriginAndElementDest($currentDelegation["TAS_UID"], $nextDel["TAS_UID"], $appFields, $flagFirstIteration, true, $nextDel['ROU_CONDITION']);
}
break; break;
case TASK_FINISH_TASK: case TASK_FINISH_TASK:
$iAppThreadIndex = $appFields['DEL_THREAD']; $iAppThreadIndex = $appFields['DEL_THREAD'];