// set end time for processinstance end time
context.setMaxEndTime(context.getClock().getCurrentTime());
String type = (String) provider.getProcessDataForNode(node).get("node.type");
return new ActivitySimulationEvent(pi.getProcessId(), context.getProcessInstanceId(), node.getName(), bpmn2NodeId, duration,
startTime, context.getClock().getCurrentTime(), type);
}