Update for BPMN Gateways to Routes handling for BpmnWorkflow adapter
This commit is contained in:
@@ -17,6 +17,12 @@ class BpmnWorkflow extends Project\Bpmn
|
|||||||
*/
|
*/
|
||||||
protected $wp;
|
protected $wp;
|
||||||
|
|
||||||
|
const BPMN_GATEWAY_COMPLEX = "COMPLEX";
|
||||||
|
const BPMN_GATEWAY_PARALLEL = "PARALLEL";
|
||||||
|
const BPMN_GATEWAY_INCLUSIVE = "INCLUSIVE";
|
||||||
|
const BPMN_GATEWAY_EXCLUSIVE = "EXCLUSIVE";
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OVERRIDES
|
* OVERRIDES
|
||||||
*/
|
*/
|
||||||
@@ -139,8 +145,12 @@ class BpmnWorkflow extends Project\Bpmn
|
|||||||
$this->wp->removeTask($actUid);
|
$this->wp->removeTask($actUid);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addFlow($data, $flows, $gateways, $events)
|
public function addFlow($data, $diagram)
|
||||||
{
|
{
|
||||||
|
$flows = $diagram["flows"];
|
||||||
|
$gateways = $diagram["gateways"];
|
||||||
|
$events = $diagram["events"];
|
||||||
|
|
||||||
parent::addFlow($data);
|
parent::addFlow($data);
|
||||||
|
|
||||||
// to add a workflow route
|
// to add a workflow route
|
||||||
@@ -291,23 +301,39 @@ class BpmnWorkflow extends Project\Bpmn
|
|||||||
|
|
||||||
if (! empty($gateways)) {
|
if (! empty($gateways)) {
|
||||||
$gateway = $gateways[0];
|
$gateway = $gateways[0];
|
||||||
|
$routeType = "";
|
||||||
|
|
||||||
switch ($gateway['GAT_TYPE']) {
|
switch ($gateway['GAT_TYPE']) {
|
||||||
case 'SELECTION':
|
case self::BPMN_GATEWAY_COMPLEX:
|
||||||
$routeType = 'SELECT';
|
$routeType = 'SELECT';
|
||||||
break;
|
break;
|
||||||
case 'EVALUATION':
|
case self::BPMN_GATEWAY_EXCLUSIVE:
|
||||||
$routeType = 'EVALUATE';
|
$routeType = 'EVALUATE';
|
||||||
break;
|
break;
|
||||||
case 'PARALLEL':
|
case self::BPMN_GATEWAY_INCLUSIVE:
|
||||||
$routeType = 'PARALLEL';
|
switch ($gateway['GAT_DIRECTION']) {
|
||||||
break;
|
case "DIVERGING":
|
||||||
case 'PARALLEL_EVALUATION':
|
|
||||||
$routeType = 'PARALLEL-BY-EVALUATION';
|
$routeType = 'PARALLEL-BY-EVALUATION';
|
||||||
break;
|
break;
|
||||||
case 'PARALLEL_JOIN':
|
case "CONVERGING":
|
||||||
$routeType = 'SEC-JOIN';
|
$routeType = 'SEC-JOIN';
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
throw new \LogicException(sprintf("Unsupported Gateway direction: %s", $gateway['GAT_DIRECTION']));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case self::BPMN_GATEWAY_PARALLEL:
|
||||||
|
switch ($gateway['GAT_DIRECTION']) {
|
||||||
|
case "DIVERGING":
|
||||||
|
$routeType = 'PARALLEL';
|
||||||
|
break;
|
||||||
|
case "CONVERGING":
|
||||||
|
$routeType = 'SEC-JOIN';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new \LogicException(sprintf("Unsupported Gateway direction: %s", $gateway['GAT_DIRECTION']));
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new \LogicException(sprintf("Unsupported Gateway type: %s", $gateway['GAT_TYPE']));
|
throw new \LogicException(sprintf("Unsupported Gateway type: %s", $gateway['GAT_TYPE']));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -249,7 +249,7 @@ class Project extends Api
|
|||||||
foreach ($diagram["flows"] as $flowData) {
|
foreach ($diagram["flows"] as $flowData) {
|
||||||
$flow = $bwp->getFlow($flowData["FLO_UID"]);
|
$flow = $bwp->getFlow($flowData["FLO_UID"]);
|
||||||
if (is_null($flow)) {
|
if (is_null($flow)) {
|
||||||
$bwp->addFlow($flowData, $diagram["flows"], $diagram["gateways"], $diagram["events"]);
|
$bwp->addFlow($flowData, $diagram);
|
||||||
} elseif (! $bwp->isEquals($flow, $flowData)) {
|
} elseif (! $bwp->isEquals($flow, $flowData)) {
|
||||||
$bwp->updateFlow($flowData["FLO_UID"], $flowData);
|
$bwp->updateFlow($flowData["FLO_UID"], $flowData);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user