parseListener.parseIntermediateMessageCatchEventDefinition(messageEventDefinition, nestedActivity);
}
}
public ActivityImpl parseIntermediateThrowEvent(Element intermediateEventElement, ScopeImpl scopeElement) {
ActivityImpl nestedActivityImpl = createActivityOnScope(intermediateEventElement, scopeElement);
ActivityBehavior activityBehavior = null;
Element signalEventDefinitionElement = intermediateEventElement.element("signalEventDefinition");
Element compensateEventDefinitionElement = intermediateEventElement.element("compensateEventDefinition");
boolean otherUnsupportedThrowingIntermediateEvent =
(intermediateEventElement.element("escalationEventDefinition") != null) || //
(intermediateEventElement.element("messageEventDefinition") != null) || //
(intermediateEventElement.element("linkEventDefinition") != null);
// All other event definition types cannot be intermediate throwing (cancelEventDefinition, conditionalEventDefinition, errorEventDefinition, terminateEventDefinition, timerEventDefinition
if(signalEventDefinitionElement != null) {
nestedActivityImpl.setProperty("type", "intermediateSignalThrow");
EventSubscriptionDeclaration signalDefinition = parseSignalEventDefinition(signalEventDefinitionElement);
activityBehavior = new IntermediateThrowSignalEventActivityBehavior(signalDefinition);
} else if(compensateEventDefinitionElement != null) {
CompensateEventDefinition compensateEventDefinition = parseCompensateEventDefinition(compensateEventDefinitionElement, scopeElement);
activityBehavior = new IntermediateThrowCompensationEventActivityBehavior(compensateEventDefinition);
// IntermediateThrowNoneEventActivityBehavior
} else if (otherUnsupportedThrowingIntermediateEvent) {
addError("Unsupported intermediate throw event type", intermediateEventElement);
} else { // None intermediate event
activityBehavior = new IntermediateThrowNoneEventActivityBehavior();
}
for (BpmnParseListener parseListener : parseListeners) {
parseListener.parseIntermediateThrowEvent(intermediateEventElement, scopeElement, nestedActivityImpl);
}
nestedActivityImpl.setActivityBehavior(activityBehavior);
parseExecutionListenersOnScope(intermediateEventElement, nestedActivityImpl);
return nestedActivityImpl;
}