diff --git a/src/ProcessMaker/Nayra/Bpmn/ActivityTrait.php b/src/ProcessMaker/Nayra/Bpmn/ActivityTrait.php index 162beee1..b6ee29c5 100755 --- a/src/ProcessMaker/Nayra/Bpmn/ActivityTrait.php +++ b/src/ProcessMaker/Nayra/Bpmn/ActivityTrait.php @@ -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; }