use of org.camunda.bpm.engine.impl.bpmn.parser.EscalationEventDefinition in project camunda-bpm-platform by camunda.
the class ThrowEscalationEventActivityBehavior method execute.
@Override
public void execute(ActivityExecution execution) throws Exception {
final PvmActivity currentActivity = execution.getActivity();
final EscalationEventDefinitionFinder escalationEventDefinitionFinder = new EscalationEventDefinitionFinder(escalation.getEscalationCode(), currentActivity);
ActivityExecutionMappingCollector activityExecutionMappingCollector = new ActivityExecutionMappingCollector(execution);
ActivityExecutionHierarchyWalker walker = new ActivityExecutionHierarchyWalker(execution);
walker.addScopePreVisitor(escalationEventDefinitionFinder);
walker.addExecutionPreVisitor(activityExecutionMappingCollector);
walker.addExecutionPreVisitor(new OutputVariablesPropagator());
walker.walkUntil(new ReferenceWalker.WalkCondition<ActivityExecutionTuple>() {
@Override
public boolean isFulfilled(ActivityExecutionTuple element) {
return escalationEventDefinitionFinder.getEscalationEventDefinition() != null || element == null;
}
});
EscalationEventDefinition escalationEventDefinition = escalationEventDefinitionFinder.getEscalationEventDefinition();
if (escalationEventDefinition != null) {
executeEscalationHandler(escalationEventDefinition, activityExecutionMappingCollector);
}
if (escalationEventDefinition == null || !escalationEventDefinition.isCancelActivity()) {
leaveExecution(execution, currentActivity, escalationEventDefinition);
}
}
Aggregations