From 75a7f10cb002eef64ea7ec421e22a9b6ba04804b Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Fri, 2 Oct 2020 17:39:02 -0400 Subject: [PATCH 1/3] Add multiple outgoing task pattern --- .../Patterns/files/TaskMultipleOutgoing.bpmn | 101 ++++++++++++++++++ .../Patterns/files/TaskMultipleOutgoing.json | 13 +++ 2 files changed, 114 insertions(+) create mode 100644 tests/Feature/Patterns/files/TaskMultipleOutgoing.bpmn create mode 100644 tests/Feature/Patterns/files/TaskMultipleOutgoing.json diff --git a/tests/Feature/Patterns/files/TaskMultipleOutgoing.bpmn b/tests/Feature/Patterns/files/TaskMultipleOutgoing.bpmn new file mode 100644 index 00000000..85cedac8 --- /dev/null +++ b/tests/Feature/Patterns/files/TaskMultipleOutgoing.bpmn @@ -0,0 +1,101 @@ + + + + + node_3 + + + node_3 + node_7 + + + + node_7 + node_9 + node_14 + node_5 + + + + node_9 + node_11 + + + + node_11 + + + + node_5 + node_15 + + + + node_15 + + + + node_14 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/Feature/Patterns/files/TaskMultipleOutgoing.json b/tests/Feature/Patterns/files/TaskMultipleOutgoing.json new file mode 100644 index 00000000..18b09b76 --- /dev/null +++ b/tests/Feature/Patterns/files/TaskMultipleOutgoing.json @@ -0,0 +1,13 @@ +[ + { + "startEvent": "node_1", + "data": { + }, + "result": [ + "node_2", + "node_6", + "node_8", + "node_4" + ] + } +] From 9316cf22120f9729cd2ebc6a6c2a44149a588e79 Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Fri, 2 Oct 2020 17:45:04 -0400 Subject: [PATCH 2/3] Close task just after completition --- src/ProcessMaker/Nayra/Bpmn/ActivityTrait.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ProcessMaker/Nayra/Bpmn/ActivityTrait.php b/src/ProcessMaker/Nayra/Bpmn/ActivityTrait.php index ad3e3365..b5c4466e 100755 --- a/src/ProcessMaker/Nayra/Bpmn/ActivityTrait.php +++ b/src/ProcessMaker/Nayra/Bpmn/ActivityTrait.php @@ -76,7 +76,7 @@ public function buildTransitions(RepositoryInterface $factory) $this->exceptionTransition = new ExceptionTransition($this, true); $this->closeExceptionTransition = new CloseExceptionTransition($this, true); $this->completeExceptionTransition = new CompleteExceptionTransition($this, true); - $this->transition = new Transition($this, true); + $this->transition = new Transition($this, false); $this->closedState = new State($this, ActivityInterface::TOKEN_STATE_COMPLETED); $this->activeState->connectTo($this->exceptionTransition); @@ -155,7 +155,7 @@ function ($transition, $tokens) { */ public function getInputPlace(FlowInterface $targetFlow = null) { - $ready = new State($this); + $ready = new State($this, 'INCOMING'); $transition = new Transition($this, false); $ready->connectTo($transition); $transition->connectTo($this->activeState); @@ -176,10 +176,12 @@ protected function buildConnectionTo(FlowInterface $targetFlow) $target = $targetFlow->getTarget(); $place = $target->getInputPlace($targetFlow); $this->transition->connectTo($place); - $place->attachEvent( - StateInterface::EVENT_TOKEN_CONSUMED, - function (TokenInterface $token) { - $token->setStatus(ActivityInterface::TOKEN_STATE_CLOSED); + $this->transition->attachEvent( + TransitionInterface::EVENT_AFTER_CONSUME, + function (TransitionInterface $transition, Collection $consumedTokens) { + foreach ($consumedTokens as $token) { + $token->setStatus(ActivityInterface::TOKEN_STATE_CLOSED); + } $this->getRepository() ->getTokenRepository() ->persistActivityClosed($this, $token); From c4d3b56ccd75398949fcf4ff53449c15a63e9aad Mon Sep 17 00:00:00 2001 From: David Callizaya Date: Fri, 2 Oct 2020 17:45:27 -0400 Subject: [PATCH 3/3] Update test, close events --- tests/Feature/Engine/EventBasedGatewayTest.php | 8 ++++---- tests/Feature/Engine/ExclusiveGatewayTest.php | 4 ++-- tests/Feature/Engine/InclusiveGatewayTest.php | 6 +++--- .../Feature/Engine/IntermediateMessageEventTest.php | 4 ++-- tests/Feature/Engine/LoadExecutionInstancesTest.php | 8 ++++---- tests/Feature/Engine/LoadFromBPMNFileTest.php | 12 ++++++------ tests/Feature/Engine/MessageStartEventTest.php | 2 +- tests/Feature/Engine/NayraModelTest.php | 4 ++-- tests/Feature/Engine/ParallelGatewayTest.php | 8 ++++---- tests/Feature/Engine/SaveExecutionInstancesTest.php | 2 +- tests/Feature/Engine/SignalStartEventTest.php | 2 +- tests/Feature/Engine/TerminateEventTest.php | 2 +- 12 files changed, 31 insertions(+), 31 deletions(-) diff --git a/tests/Feature/Engine/EventBasedGatewayTest.php b/tests/Feature/Engine/EventBasedGatewayTest.php index b5141911..9ed976da 100644 --- a/tests/Feature/Engine/EventBasedGatewayTest.php +++ b/tests/Feature/Engine/EventBasedGatewayTest.php @@ -73,10 +73,10 @@ public function testDeferredChoiceChoiceOne() EventInterface::EVENT_EVENT_TRIGGERED, ActivityInterface::EVENT_ACTIVITY_ACTIVATED, ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, GatewayInterface::EVENT_GATEWAY_ACTIVATED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, @@ -109,6 +109,7 @@ public function testDeferredChoiceChoiceOne() $this->completeTask($approve, $manager); $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, IntermediateCatchEventInterface::EVENT_CATCH_MESSAGE_CATCH, ThrowEventInterface::EVENT_THROW_TOKEN_ARRIVES, IntermediateCatchEventInterface::EVENT_CATCH_TOKEN_CONSUMED, @@ -118,7 +119,6 @@ public function testDeferredChoiceChoiceOne() IntermediateCatchEventInterface::EVENT_CATCH_TOKEN_CONSUMED, ActivityInterface::EVENT_ACTIVITY_ACTIVATED, ThrowEventInterface::EVENT_THROW_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, ThrowEventInterface::EVENT_THROW_TOKEN_PASSED, ThrowEventInterface::EVENT_THROW_TOKEN_ARRIVES, ThrowEventInterface::EVENT_THROW_TOKEN_CONSUMED, @@ -173,10 +173,10 @@ public function testDeferredChoiceChoiceTwo() EventInterface::EVENT_EVENT_TRIGGERED, ActivityInterface::EVENT_ACTIVITY_ACTIVATED, ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, GatewayInterface::EVENT_GATEWAY_ACTIVATED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, @@ -210,6 +210,7 @@ public function testDeferredChoiceChoiceTwo() $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, IntermediateCatchEventInterface::EVENT_CATCH_MESSAGE_CATCH, ThrowEventInterface::EVENT_THROW_TOKEN_ARRIVES, IntermediateCatchEventInterface::EVENT_CATCH_TOKEN_CONSUMED, @@ -219,7 +220,6 @@ public function testDeferredChoiceChoiceTwo() IntermediateCatchEventInterface::EVENT_CATCH_TOKEN_CONSUMED, ActivityInterface::EVENT_ACTIVITY_ACTIVATED, ThrowEventInterface::EVENT_THROW_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, ThrowEventInterface::EVENT_THROW_TOKEN_PASSED, ThrowEventInterface::EVENT_THROW_TOKEN_ARRIVES, ThrowEventInterface::EVENT_THROW_TOKEN_CONSUMED, diff --git a/tests/Feature/Engine/ExclusiveGatewayTest.php b/tests/Feature/Engine/ExclusiveGatewayTest.php index db89dcb1..15fac293 100644 --- a/tests/Feature/Engine/ExclusiveGatewayTest.php +++ b/tests/Feature/Engine/ExclusiveGatewayTest.php @@ -347,10 +347,10 @@ public function testParallelDivergingExclusiveConverging() //Assertion: Verify the triggered engine events. The activity is closed. $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, GatewayInterface::EVENT_GATEWAY_ACTIVATED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, TransitionInterface::EVENT_CONDITIONED_TRANSITION, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, ActivityInterface::EVENT_ACTIVITY_ACTIVATED, @@ -364,10 +364,10 @@ public function testParallelDivergingExclusiveConverging() //Assertion: Verify the triggered engine events. The activity B is closed. $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, GatewayInterface::EVENT_GATEWAY_ACTIVATED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, TransitionInterface::EVENT_CONDITIONED_TRANSITION, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, ActivityInterface::EVENT_ACTIVITY_ACTIVATED, diff --git a/tests/Feature/Engine/InclusiveGatewayTest.php b/tests/Feature/Engine/InclusiveGatewayTest.php index 34b3bdc7..afdf44ba 100755 --- a/tests/Feature/Engine/InclusiveGatewayTest.php +++ b/tests/Feature/Engine/InclusiveGatewayTest.php @@ -163,6 +163,7 @@ public function testInclusiveGatewayAllPaths() //Assertion: Verify the triggered engine events. The activity is closed. $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, ]); @@ -174,12 +175,11 @@ public function testInclusiveGatewayAllPaths() //Assertion: Verify the triggered engine events. The activity is closed and process is ended. $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, GatewayInterface::EVENT_GATEWAY_ACTIVATED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, EndEventInterface::EVENT_THROW_TOKEN_ARRIVES, EndEventInterface::EVENT_THROW_TOKEN_CONSUMED, @@ -231,10 +231,10 @@ public function testInclusiveGatewayOnlyB() //Assertion: Verify the triggered engine events. The activity is closed and process is ended. $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, GatewayInterface::EVENT_GATEWAY_ACTIVATED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, EndEventInterface::EVENT_THROW_TOKEN_ARRIVES, EndEventInterface::EVENT_THROW_TOKEN_CONSUMED, diff --git a/tests/Feature/Engine/IntermediateMessageEventTest.php b/tests/Feature/Engine/IntermediateMessageEventTest.php index 8b5dc13e..ac9c467c 100644 --- a/tests/Feature/Engine/IntermediateMessageEventTest.php +++ b/tests/Feature/Engine/IntermediateMessageEventTest.php @@ -303,6 +303,7 @@ public function testIntermediateEvent() //Assertion: The throwing process must advances to activity B an the catching process to activity D $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, IntermediateCatchEventInterface::EVENT_CATCH_MESSAGE_CATCH, IntermediateThrowEventInterface::EVENT_THROW_TOKEN_ARRIVES, @@ -313,7 +314,6 @@ public function testIntermediateEvent() EventInterface::EVENT_EVENT_TRIGGERED, ActivityInterface::EVENT_ACTIVITY_ACTIVATED, IntermediateThrowEventInterface::EVENT_THROW_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, IntermediateThrowEventInterface::EVENT_THROW_TOKEN_PASSED, ActivityInterface::EVENT_ACTIVITY_ACTIVATED ]); @@ -405,6 +405,7 @@ public function testSignalEvent() //Assertion: The throwing process must advances to activity B an the catching process to activity D $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, IntermediateCatchEventInterface::EVENT_CATCH_MESSAGE_CATCH, IntermediateThrowEventInterface::EVENT_THROW_TOKEN_ARRIVES, @@ -415,7 +416,6 @@ public function testSignalEvent() EventInterface::EVENT_EVENT_TRIGGERED, ActivityInterface::EVENT_ACTIVITY_ACTIVATED, IntermediateThrowEventInterface::EVENT_THROW_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, IntermediateThrowEventInterface::EVENT_THROW_TOKEN_PASSED, ActivityInterface::EVENT_ACTIVITY_ACTIVATED ]); diff --git a/tests/Feature/Engine/LoadExecutionInstancesTest.php b/tests/Feature/Engine/LoadExecutionInstancesTest.php index c81a1393..dfe96212 100644 --- a/tests/Feature/Engine/LoadExecutionInstancesTest.php +++ b/tests/Feature/Engine/LoadExecutionInstancesTest.php @@ -190,14 +190,14 @@ public function testLoadExecutionInstanceWithMultipleTokens() //Assertion: Second and third activity are completed and closed, the gateway is activate, and the process ends. $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, GatewayInterface::EVENT_GATEWAY_ACTIVATED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, EndEventInterface::EVENT_THROW_TOKEN_ARRIVES, EndEventInterface::EVENT_THROW_TOKEN_CONSUMED, @@ -237,14 +237,14 @@ public function testLoadExecutionInstanceWithMultipleTokensStates() //Assertion: Second activity is closed and the third activity are completed, then closed, the join gateway is activiate, and finally the process is completed. $this->assertEvents([ + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, GatewayInterface::EVENT_GATEWAY_ACTIVATED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, EndEventInterface::EVENT_THROW_TOKEN_ARRIVES, EndEventInterface::EVENT_THROW_TOKEN_CONSUMED, diff --git a/tests/Feature/Engine/LoadFromBPMNFileTest.php b/tests/Feature/Engine/LoadFromBPMNFileTest.php index 057ba2f3..cff00fd6 100644 --- a/tests/Feature/Engine/LoadFromBPMNFileTest.php +++ b/tests/Feature/Engine/LoadFromBPMNFileTest.php @@ -105,10 +105,10 @@ public function testParallelGateway() ActivityInterface::EVENT_ACTIVITY_ACTIVATED, ScriptTaskInterface::EVENT_SCRIPT_TASK_ACTIVATED, ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, GatewayInterface::EVENT_GATEWAY_ACTIVATED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, ActivityInterface::EVENT_ACTIVITY_ACTIVATED, @@ -129,6 +129,7 @@ public function testParallelGateway() //Assertion: Verify the triggered engine events. The activity is closed. $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, ]); @@ -140,12 +141,11 @@ public function testParallelGateway() //Assertion: Verify the triggered engine events. The activity B is closed and process is ended. $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, GatewayInterface::EVENT_GATEWAY_ACTIVATED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, ActivityInterface::EVENT_ACTIVITY_ACTIVATED, ScriptTaskInterface::EVENT_SCRIPT_TASK_ACTIVATED, @@ -222,10 +222,10 @@ public function testInclusiveGatewayWithDefault() ActivityInterface::EVENT_ACTIVITY_ACTIVATED, ScriptTaskInterface::EVENT_SCRIPT_TASK_ACTIVATED, ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, GatewayInterface::EVENT_GATEWAY_ACTIVATED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, ActivityInterface::EVENT_ACTIVITY_ACTIVATED, @@ -242,6 +242,7 @@ public function testInclusiveGatewayWithDefault() //Assertion: Verify the triggered engine events. The activity is closed. $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, ]); @@ -253,12 +254,11 @@ public function testInclusiveGatewayWithDefault() //Assertion: Verify the triggered engine events. The activity is closed and process is ended. $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, GatewayInterface::EVENT_GATEWAY_ACTIVATED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, ActivityInterface::EVENT_ACTIVITY_ACTIVATED, ScriptTaskInterface::EVENT_SCRIPT_TASK_ACTIVATED, diff --git a/tests/Feature/Engine/MessageStartEventTest.php b/tests/Feature/Engine/MessageStartEventTest.php index 73128425..e2440e83 100644 --- a/tests/Feature/Engine/MessageStartEventTest.php +++ b/tests/Feature/Engine/MessageStartEventTest.php @@ -162,12 +162,12 @@ public function testMessageStartEvent() //Assertion: The process1 activity should be finished and a new instance of the second process must be created $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, ProcessInterface::EVENT_PROCESS_INSTANCE_CREATED, IntermediateThrowEventInterface::EVENT_THROW_TOKEN_ARRIVES, //events triggered when the catching event runs IntermediateThrowEventInterface::EVENT_THROW_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, IntermediateThrowEventInterface::EVENT_THROW_TOKEN_PASSED, //Actibity activated in the first process diff --git a/tests/Feature/Engine/NayraModelTest.php b/tests/Feature/Engine/NayraModelTest.php index 3507bb2c..8ac6a85f 100644 --- a/tests/Feature/Engine/NayraModelTest.php +++ b/tests/Feature/Engine/NayraModelTest.php @@ -108,6 +108,7 @@ public function testProcessWithInclusiveGateway() //Assertion: Verify the triggered engine events. The activity is closed. $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, ]); @@ -119,12 +120,11 @@ public function testProcessWithInclusiveGateway() //Assertion: Verify the triggered engine events. The activity is closed and process is ended. $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, GatewayInterface::EVENT_GATEWAY_ACTIVATED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, EndEventInterface::EVENT_THROW_TOKEN_ARRIVES, EndEventInterface::EVENT_THROW_TOKEN_CONSUMED, diff --git a/tests/Feature/Engine/ParallelGatewayTest.php b/tests/Feature/Engine/ParallelGatewayTest.php index ec26c209..a11c8c3c 100644 --- a/tests/Feature/Engine/ParallelGatewayTest.php +++ b/tests/Feature/Engine/ParallelGatewayTest.php @@ -163,6 +163,7 @@ public function testParallelGateway() //Assertion: Verify the triggered engine events. The activity is closed. $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, ]); @@ -174,12 +175,11 @@ public function testParallelGateway() //Assertion: Verify the triggered engine events. The activity B is closed and process is ended. $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, GatewayInterface::EVENT_GATEWAY_ACTIVATED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, ActivityInterface::EVENT_ACTIVITY_ACTIVATED, ]); @@ -256,6 +256,7 @@ public function testParallelDivergingInclusiveConverging() //Assertion: Verify the triggered engine events. The activity is closed. $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, ]); @@ -267,12 +268,11 @@ public function testParallelDivergingInclusiveConverging() //Assertion: Verify the triggered engine events. The activity B is closed. $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, GatewayInterface::EVENT_GATEWAY_ACTIVATED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, ActivityInterface::EVENT_ACTIVITY_ACTIVATED, ]); diff --git a/tests/Feature/Engine/SaveExecutionInstancesTest.php b/tests/Feature/Engine/SaveExecutionInstancesTest.php index 6b6bf8ee..07370d57 100644 --- a/tests/Feature/Engine/SaveExecutionInstancesTest.php +++ b/tests/Feature/Engine/SaveExecutionInstancesTest.php @@ -176,7 +176,7 @@ public function testSaveExecutionInstanceWithMultipleTokens() //Assertion: Saved data show the first activity was closed, the second is completed, and the third is active $this->assertSavedTokens($instance->getId(), [ ['elementId' => 'task1', 'status' => ActivityInterface::TOKEN_STATE_CLOSED], - ['elementId' => 'task2', 'status' => ActivityInterface::TOKEN_STATE_COMPLETED], + ['elementId' => 'task2', 'status' => ActivityInterface::TOKEN_STATE_CLOSED], ['elementId' => 'task3', 'status' => ActivityInterface::TOKEN_STATE_ACTIVE], ]); diff --git a/tests/Feature/Engine/SignalStartEventTest.php b/tests/Feature/Engine/SignalStartEventTest.php index a4e4e39c..ac1a68a4 100644 --- a/tests/Feature/Engine/SignalStartEventTest.php +++ b/tests/Feature/Engine/SignalStartEventTest.php @@ -158,12 +158,12 @@ public function testSignalStartEvent() //Assertion: The process1 activity should be finished and a new instance of the second process must be created $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, ProcessInterface::EVENT_PROCESS_INSTANCE_CREATED, IntermediateThrowEventInterface::EVENT_THROW_TOKEN_ARRIVES, //Events triggered when the catching event runs IntermediateThrowEventInterface::EVENT_THROW_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, IntermediateThrowEventInterface::EVENT_THROW_TOKEN_PASSED, //Next activity should be activated in the first process diff --git a/tests/Feature/Engine/TerminateEventTest.php b/tests/Feature/Engine/TerminateEventTest.php index 50c8dda3..f518380c 100644 --- a/tests/Feature/Engine/TerminateEventTest.php +++ b/tests/Feature/Engine/TerminateEventTest.php @@ -66,10 +66,10 @@ public function testTerminateEndEvent() //Assertion: The terminate event was activated and the process was ended $this->assertEvents([ ActivityInterface::EVENT_ACTIVITY_COMPLETED, + ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_ARRIVES, GatewayInterface::EVENT_GATEWAY_ACTIVATED, GatewayInterface::EVENT_GATEWAY_TOKEN_CONSUMED, - ActivityInterface::EVENT_ACTIVITY_CLOSED, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, GatewayInterface::EVENT_GATEWAY_TOKEN_PASSED, ThrowEventInterface::EVENT_THROW_TOKEN_ARRIVES,