public void destroyCase(CaseContext caseContext) { KieSession kieSession = null; RuntimeEngine localRuntime = findLocalRuntime(caseContext.getContextId()); if (localRuntime != null) { kieSession = localRuntime.getKieSession(); } else { Long ksessionId = mapper.findMapping(caseContext, this.identifier); if (ksessionId != null) { kieSession = factory.findKieSessionById(ksessionId); } } factory.onDispose(kieSession.getIdentifier()); List<ExecutableCommand<?>> cmds = new ArrayList<>(); RemoveMappingCommand removeMapping = new RemoveMappingCommand(mapper, caseContext, getIdentifier()); cmds.add(removeMapping); DestroyKSessionCommand destroy = new DestroyKSessionCommand(kieSession, this); cmds.add(destroy); BatchExecutionCommand batchCmd = new BatchExecutionCommandImpl(cmds); kieSession.execute(batchCmd); }
try { Long ksessionId = ((RuntimeEngineImpl)runtime).getKieSessionId(); factory.onDispose(ksessionId); if (canDestroy(runtime)) { runtime.getKieSession().destroy();
@Override public void afterProcessCompleted(ProcessCompletedEvent event) { mapper.removeMapping(new EnvironmentAwareProcessInstanceContext( event.getKieRuntime().getEnvironment(), event.getProcessInstance().getId()), managerId); factory.onDispose(runtime.getKieSession().getIdentifier()); registerDisposeCallback(runtime, new DestroySessionTransactionSynchronization(runtime.getKieSession()), runtime.getKieSession().getEnvironment()); }
factory.onDispose(initialKsession.getIdentifier()); initialKsession.execute(new DestroyKSessionCommand(initialKsession, this));
factory.onDispose(initialKsession.getIdentifier()); initialKsession.execute(new DestroyKSessionCommand(initialKsession, this));
try { Long ksessionId = ((RuntimeEngineImpl)runtime).getKieSessionId(); factory.onDispose(ksessionId); if (canDestroy(runtime)) { runtime.getKieSession().destroy();
public void destroyCase(CaseContext caseContext) { KieSession kieSession = null; RuntimeEngine localRuntime = findLocalRuntime(caseContext.getContextId()); if (localRuntime != null) { kieSession = localRuntime.getKieSession(); } else { Long ksessionId = mapper.findMapping(caseContext, this.identifier); if (ksessionId != null) { kieSession = factory.findKieSessionById(ksessionId); } } factory.onDispose(kieSession.getIdentifier()); List<ExecutableCommand<?>> cmds = new ArrayList<>(); RemoveMappingCommand removeMapping = new RemoveMappingCommand(mapper, caseContext, getIdentifier()); cmds.add(removeMapping); DestroyKSessionCommand destroy = new DestroyKSessionCommand(kieSession, this); cmds.add(destroy); BatchExecutionCommand batchCmd = new BatchExecutionCommandImpl(cmds); kieSession.execute(batchCmd); }
@Override public void afterProcessCompleted(ProcessCompletedEvent event) { mapper.removeMapping(new EnvironmentAwareProcessInstanceContext( event.getKieRuntime().getEnvironment(), event.getProcessInstance().getId()), managerId); factory.onDispose(runtime.getKieSession().getIdentifier()); registerDisposeCallback(runtime, new DestroySessionTransactionSynchronization(runtime.getKieSession()), runtime.getKieSession().getEnvironment()); }
factory.onDispose(initialKsession.getIdentifier()); initialKsession.execute(new DestroyKSessionCommand(initialKsession, this));
factory.onDispose(initialKsession.getIdentifier()); initialKsession.execute(new DestroyKSessionCommand(initialKsession, this));