I solve the problem when save the default gateway
This commit is contained in:
@@ -1666,6 +1666,8 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
* Diagram's Flows Handling
|
||||
*/
|
||||
$whiteList = array();
|
||||
$defaultFlow = array();
|
||||
$pos = 0;
|
||||
|
||||
foreach ($diagram["flows"] as $i => $flowData) {
|
||||
$flowData = array_change_key_case($flowData, CASE_UPPER);
|
||||
@@ -1693,6 +1695,12 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
$flowData["FLO_ELEMENT_DEST"] = $mappedUid;
|
||||
}
|
||||
}
|
||||
//Save the default flow Uid's
|
||||
if($flowData["FLO_TYPE"] == 'DEFAULT'){
|
||||
$defaultFlow[$pos]['GAT_UID'] = $flowData["FLO_ELEMENT_ORIGIN"];
|
||||
$defaultFlow[$pos]['GAT_DEFAULT_FLOW'] = $flowData["FLO_UID"];
|
||||
$pos++;
|
||||
}
|
||||
|
||||
//Update UIDs
|
||||
foreach ($result as $value) {
|
||||
@@ -1735,6 +1743,17 @@ class BpmnWorkflow extends Project\Bpmn
|
||||
}
|
||||
|
||||
$bwp->mapBpmnFlowsToWorkflowRoutes();
|
||||
|
||||
//Update the Default gateway
|
||||
$gateways = $bwp->getGateways();
|
||||
foreach ($gateways as $gatewayData) {
|
||||
foreach ($defaultFlow as $def) {
|
||||
if($gatewayData["GAT_UID"] == $def["GAT_UID"]){
|
||||
$gatewayData["GAT_DEFAULT_FLOW"] = $def["GAT_DEFAULT_FLOW"];
|
||||
$bwp->updateGateway($gatewayData["GAT_UID"], $gatewayData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user