Skip to content

Commit

Permalink
Merge pull request #228 from ProcessMaker/FOUR-15486
Browse files Browse the repository at this point in the history
FOUR-15486 Fix flow elements evaluates only once running tests cases
  • Loading branch information
ryancooley authored Jun 18, 2024
2 parents 4f32051 + db30b1d commit b527165
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ProcessMaker/Nayra/Bpmn/ActivityTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,14 @@ function ($transition, $tokens) {
foreach ($tokens as $token) {
foreach ($boundaryEvents as $boundaryEvent) {
$caughtEventDefinition = $token->getProperty(TokenInterface::BPMN_PROPERTY_EVENT_DEFINITION_CAUGHT);
$caughtEventId = $token->getProperty(TokenInterface::BPMN_PROPERTY_EVENT_ID);
foreach ($boundaryEvent->getEventDefinitions() as $eventDefinition) {
if ($caughtEventDefinition === $eventDefinition->getId()) {
$payload = $eventDefinition->getPayload();
$eventDefinitionId = $payload ? $payload->getId() : null;
$hasPayloadId = !empty($caughtEventId) && !empty($eventDefinitionId);
$matchPayload = $hasPayloadId && ($caughtEventId === $eventDefinitionId);
$matchEventDefinition = !$hasPayloadId && ($caughtEventDefinition === $eventDefinition->getId());
if ($matchEventDefinition || $matchPayload) {
$boundaryEvent->notifyInternalEvent($token);
break 3;
}
Expand Down

0 comments on commit b527165

Please sign in to comment.