Adding Unit Tests to BpmnWorkflow Adapter

- Adding Activity->Gateway Flow handler
- Adding Activity->Gateway ==> Route Listener to Adapter

Now gateways with DIVERGING and CONVERGING directions are interpreted as its respective workflow route types.
This commit is contained in:
Erik Amaru Ortiz
2014-02-25 13:47:59 -04:00
parent 205f4a461f
commit 887fa6b46a
3 changed files with 163 additions and 43 deletions

View File

@@ -150,26 +150,26 @@ class BpmnWorkflow extends Project\Bpmn
public function removeGateway($gatUid)
{
$gatewayData = $this->getGateway($gatUid);
$flowsDest = \BpmnFlow::findAllBy(\BpmnFlowPeer::FLO_ELEMENT_DEST, $gatUid);
// $gatewayData = $this->getGateway($gatUid);
// $flowsDest = \BpmnFlow::findAllBy(\BpmnFlowPeer::FLO_ELEMENT_DEST, $gatUid);
foreach ($flowsDest as $flowDest) {
switch ($flowDest->getFloElementOriginType()) {
case "bpmnActivity":
$actUid = $flowDest->getFloElementOrigin();
$flowsOrigin = \BpmnFlow::findAllBy(\BpmnFlowPeer::FLO_ELEMENT_ORIGIN, $gatUid);
foreach ($flowsOrigin as $flowOrigin) {
switch ($flowOrigin->getFloElementDestType()) {
case "bpmnActivity":
$toActUid = $flowOrigin->getFloElementDest();
$this->wp->removeRouteFromTo($actUid, $toActUid);
break;
}
}
break;
}
}
// foreach ($flowsDest as $flowDest) {
// switch ($flowDest->getFloElementOriginType()) {
// case "bpmnActivity":
// $actUid = $flowDest->getFloElementOrigin();
// $flowsOrigin = \BpmnFlow::findAllBy(\BpmnFlowPeer::FLO_ELEMENT_ORIGIN, $gatUid);
//
// foreach ($flowsOrigin as $flowOrigin) {
// switch ($flowOrigin->getFloElementDestType()) {
// case "bpmnActivity":
// $toActUid = $flowOrigin->getFloElementDest();
// $this->wp->removeRouteFromTo($actUid, $toActUid);
// break;
// }
// }
// break;
// }
// }
parent::removeGateway($gatUid);
}
@@ -298,6 +298,10 @@ class BpmnWorkflow extends Project\Bpmn
\BpmnFlowPeer::FLO_ELEMENT_ORIGIN_TYPE => "bpmnGateway"
));
if ($gatewayFlows > 0) {
$this->wp->resetTaskRoutes($activity["ACT_UID"]);
}
foreach ($gatewayFlows as $gatewayFlow) {
$gatewayFlow = $gatewayFlow->toArray();