use of org.camunda.bpm.engine.impl.tree.ExecutionTopDownWalker in project camunda-bpm-platform by camunda.
the class ExecutionEntity method dispatchEvent.
@Override
public void dispatchEvent(VariableEvent variableEvent) {
final List<ExecutionEntity> execs = new ArrayList<ExecutionEntity>();
new ExecutionTopDownWalker(this).addPreVisitor(new TreeVisitor<ExecutionEntity>() {
@Override
public void visit(ExecutionEntity obj) {
if (!obj.getEventSubscriptions().isEmpty() && (obj.isInState(ActivityInstanceState.DEFAULT) || (!obj.getActivity().isScope()))) {
// state is default or tree is compacted
execs.add(obj);
}
}
}).walkUntil();
for (ExecutionEntity execution : execs) {
execution.handleConditionalEventOnVariableChange(variableEvent);
}
}
Aggregations