KieSession session = ((KnowledgeCommandContext)context).getKieSession();
session.getEnvironment().set("NodeInstanceFactoryRegistry", SimulationNodeInstanceFactoryRegistry.getInstance());
simContext.setClock((SessionPseudoClock) session.getSessionClock());
simContext.setCurrentPath(path);
SimulationInfo simInfo = simContext.getRepository().getSimulationInfo();
if (simInfo != null) {
simInfo.setProcessName(session.getKieBase().getProcess(processId).getName());
simInfo.setProcessVersion(session.getKieBase().getProcess(processId).getVersion());
}
// reset max end time before starting new instance
simContext.resetMaxEndTime();
simContext.getExecutedNodes().clear();
simContext.incrementProcessInstanceId();