Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;

import org.flowable.bpmn.model.Activity;
import org.flowable.bpmn.model.BoundaryEvent;
Expand Down Expand Up @@ -360,11 +361,8 @@ protected List<ExecutionEntity> createBoundaryEvents(List<BoundaryEvent> boundar
// The parent execution becomes a scope, and a child execution is created for each of the boundary events
for (BoundaryEvent boundaryEvent : boundaryEvents) {

if (!(boundaryEvent.getBehavior() instanceof BoundaryEventRegistryEventActivityBehavior)) {
if (CollectionUtil.isEmpty(boundaryEvent.getEventDefinitions())
|| (boundaryEvent.getEventDefinitions().get(0) instanceof CompensateEventDefinition)) {
continue;
}
if (!isExecutableBoundaryEvent(boundaryEvent)) {
continue;
}

// A Child execution of the current execution is created to represent the boundary event being active
Expand All @@ -389,6 +387,7 @@ protected List<ExecutionEntity> createBoundaryEvents(List<BoundaryEvent> boundar

protected void executeBoundaryEvents(List<BoundaryEvent> boundaryEvents, List<ExecutionEntity> boundaryEventExecutions) {
if (!CollectionUtil.isEmpty(boundaryEventExecutions)) {
boundaryEvents = boundaryEvents.stream().filter(this::isExecutableBoundaryEvent).collect(Collectors.toList());
Iterator<BoundaryEvent> boundaryEventsIterator = boundaryEvents.iterator();
Iterator<ExecutionEntity> boundaryEventExecutionsIterator = boundaryEventExecutions.iterator();

Expand All @@ -401,4 +400,14 @@ protected void executeBoundaryEvents(List<BoundaryEvent> boundaryEvents, List<Ex
}
}
}

private boolean isExecutableBoundaryEvent(BoundaryEvent boundaryEvent) {
if (!(boundaryEvent.getBehavior() instanceof BoundaryEventRegistryEventActivityBehavior)) {
if (CollectionUtil.isEmpty(boundaryEvent.getEventDefinitions())
|| (boundaryEvent.getEventDefinitions().get(0) instanceof CompensateEventDefinition)) {
return false;
}
}
return true;
}
}