this.events = events;
}
@Override
public void notify(DelegateTask delegateTask) {
SimulationEvent eventToSimulate = findUserTaskCompleteEvent(delegateTask);
if (eventToSimulate != null) {
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("taskId", delegateTask.getId());
properties.put("variables", eventToSimulate.getProperty(UserTaskCompleteTransformer.TASK_VARIABLES));
// we were able to resolve event to simulate automatically
SimulationEvent e = new SimulationEvent.Builder(typeToCreate).
properties(properties).
build();
SimulationRunContext.getEventCalendar().addEvent(e);
}
}