use of org.activiti.engine.impl.history.handler.ActivityInstanceStartHandler in project Activiti by Activiti.
the class MultiInstanceActivityBehavior method callCustomActivityStartListeners.
/**
* Since the first loop of the multi instance is not executed as a regular activity,
* it is needed to call the start listeners yourself.
*/
protected void callCustomActivityStartListeners(ActivityExecution execution) {
List<ExecutionListener> listeners = activity.getExecutionListeners(org.activiti.engine.impl.pvm.PvmEvent.EVENTNAME_START);
List<ExecutionListener> filteredExecutionListeners = new ArrayList<ExecutionListener>(listeners.size());
if (listeners != null) {
for (ExecutionListener executionListener : listeners) {
if (!(executionListener instanceof ActivityInstanceStartHandler)) {
filteredExecutionListeners.add(executionListener);
}
}
CallActivityListenersOperation atomicOperation = new CallActivityListenersOperation(filteredExecutionListeners);
Context.getCommandContext().performOperation(atomicOperation, (InterpretableExecution) execution);
}
}
Aggregations