-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement demo mode for Parallel gateways
- Loading branch information
Showing
4 changed files
with
75 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace ProcessMaker\Nayra\Bpmn; | ||
|
||
use ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface; | ||
use ProcessMaker\Nayra\Contracts\Bpmn\TransitionInterface; | ||
use ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface; | ||
|
||
/** | ||
* Transition rule that always pass the token. | ||
*/ | ||
class ParallelOutputTransition extends Transition implements TransitionInterface | ||
{ | ||
use ForceGatewayTransitionTrait; | ||
|
||
/** | ||
* Condition required to transit the element. | ||
* | ||
* @param \ProcessMaker\Nayra\Contracts\Bpmn\TokenInterface|null $token | ||
* @param \ProcessMaker\Nayra\Contracts\Engine\ExecutionInstanceInterface|null $executionInstance | ||
* | ||
* @return bool | ||
*/ | ||
public function assertCondition(TokenInterface $token = null, ExecutionInstanceInterface $executionInstance = null) | ||
{ | ||
// If debug mode is enabled, the transition is triggered only if it is selected | ||
if ($executionInstance && $this->shouldDebugTriggerThisTransition($executionInstance)) { | ||
return true; | ||
} | ||
// If debug mode is enabled, the transition is not triggered if it is not selected | ||
if ($executionInstance && $this->shouldDebugSkipThisTransition($executionInstance)) { | ||
return false; | ||
} | ||
|
||
// By default the transition is triggered | ||
return true; | ||
} | ||
} |