use of org.activiti.engine.impl.delegate.ActivityBehavior in project Activiti by Activiti.
the class ContinueProcessOperation method executeBoundaryEvents.
protected void executeBoundaryEvents(Collection<BoundaryEvent> boundaryEvents, ExecutionEntity execution) {
// The parent execution becomes a scope, and a child execution is created for each of the boundary events
for (BoundaryEvent boundaryEvent : boundaryEvents) {
if (CollectionUtil.isEmpty(boundaryEvent.getEventDefinitions()) || (boundaryEvent.getEventDefinitions().get(0) instanceof CompensateEventDefinition)) {
continue;
}
// A Child execution of the current execution is created to represent the boundary event being active
ExecutionEntity childExecutionEntity = commandContext.getExecutionEntityManager().createChildExecution((ExecutionEntity) execution);
childExecutionEntity.setParentId(execution.getId());
childExecutionEntity.setCurrentFlowElement(boundaryEvent);
childExecutionEntity.setScope(false);
ActivityBehavior boundaryEventBehavior = ((ActivityBehavior) boundaryEvent.getBehavior());
logger.debug("Executing boundary event activityBehavior {} with execution {}", boundaryEventBehavior.getClass(), childExecutionEntity.getId());
boundaryEventBehavior.execute(childExecutionEntity);
}
}
use of org.activiti.engine.impl.delegate.ActivityBehavior in project Activiti by Activiti.
the class MultiInstanceActivityBehavior method executeCompensationBoundaryEvents.
protected void executeCompensationBoundaryEvents(FlowElement flowElement, DelegateExecution execution) {
// Execute compensation boundary events
Collection<BoundaryEvent> boundaryEvents = findBoundaryEventsForFlowNode(execution.getProcessDefinitionId(), flowElement);
if (CollectionUtil.isNotEmpty(boundaryEvents)) {
// The parent execution becomes a scope, and a child execution is created for each of the boundary events
for (BoundaryEvent boundaryEvent : boundaryEvents) {
if (CollectionUtil.isEmpty(boundaryEvent.getEventDefinitions())) {
continue;
}
if (boundaryEvent.getEventDefinitions().get(0) instanceof CompensateEventDefinition) {
ExecutionEntity childExecutionEntity = Context.getCommandContext().getExecutionEntityManager().createChildExecution((ExecutionEntity) execution);
childExecutionEntity.setParentId(execution.getId());
childExecutionEntity.setCurrentFlowElement(boundaryEvent);
childExecutionEntity.setScope(false);
ActivityBehavior boundaryEventBehavior = ((ActivityBehavior) boundaryEvent.getBehavior());
boundaryEventBehavior.execute(childExecutionEntity);
}
}
}
}
Aggregations