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

@@ -195,8 +195,8 @@ class Workflow extends Handler
{
try {
self::log("Remove Task: $tasUid");
$task = new Task();
$task->remove($tasUid);
$task = new Tasks();
$task->deleteTask($tasUid);
self::log("Remove Task Success!");
} catch (\Exception $e) {
self::log("Exception: ", $e->getMessage(), "Trace: ", $e->getTraceAsString());
@@ -275,18 +275,18 @@ class Workflow extends Handler
}
if ($type != 'SEQUENTIAL' && $type != 'SEC-JOIN' && $type != 'DISCRIMINATOR') {
if ($this->getNumberOfRoutes($this->proUid, $fromTasUid, $toTasUid, $type) > 0) {
throw new \LogicException("Unexpected behaviour");
}
//if ($this->getNumberOfRoutes($this->proUid, $fromTasUid, $toTasUid, $type) > 0) {
//throw new \LogicException("Unexpected behaviour");
//}
}
//if ($delete || $type == 'SEQUENTIAL' || $type == 'SEC-JOIN' || $type == 'DISCRIMINATOR') {
$oTasks = new Tasks();
$oTasks->deleteAllRoutesOfTask($this->proUid, $fromTasUid);
//$oTasks = new Tasks();
//$oTasks->deleteAllRoutesOfTask($this->proUid, $fromTasUid);
//}
$result = $this->saveNewPattern($this->proUid, $fromTasUid, $toTasUid, $type, $delete);
self::log("Add Route Success! -> ", $result);
self::log("Add Route Success! - ROU_UID: ", $result);
return $result;
} catch (\Exception $e) {
@@ -295,6 +295,12 @@ class Workflow extends Handler
}
}
public function resetTaskRoutes($actUid)
{
$oTasks = new Tasks();
$oTasks->deleteAllRoutesOfTask($this->proUid, $actUid);
}
public function updateRoute($rouUid, $routeData)
{
$routeData['ROU_UID'] = $rouUid;