@Override public void init(KieServerImpl kieServer, KieServerRegistry registry) { this.rulesExecutionService = new RulesExecutionService(registry); this.batchCommandService = new DroolsKieContainerCommandServiceImpl(kieServer, registry, this.rulesExecutionService); this.registry = registry; if (registry.getKieSessionLookupManager() != null) { registry.getKieSessionLookupManager().addHandler(new DroolsKieSessionLookupHandler()); } services.add(batchCommandService); services.add(rulesExecutionService); initialized = true; }
@Override public void init(KieServerImpl kieServer, KieServerRegistry registry) { this.kieServer = kieServer; this.context = registry; configureServices(kieServer, registry); if (registry.getKieSessionLookupManager() != null) { registry.getKieSessionLookupManager().addHandler(new JBPMKieSessionLookupHandler()); } services.add(formManagerService); services.add(deploymentService); services.add(definitionService); services.add(processService); services.add(userTaskService); services.add(runtimeDataService); services.add(executorService); services.add(queryService); services.add(processInstanceMigrationService); services.add(processInstanceAdminService); services.add(userTaskAdminService); registerDefaultQueryDefinitions(); initialized = true; }
public ExecutionResults call(KieContainerInstance kci, BatchExecutionCommand executionCommand) { BatchExecutionCommandImpl command = (BatchExecutionCommandImpl) executionCommand; if (kci != null && kci.getKieContainer() != null) { // find the session CommandExecutor ks = null; if( command.getLookup() != null ) { ks = context.getKieSessionLookupManager().lookup(command.getLookup(), kci, context); } else { // if no session ID is defined, then the default is a stateful session ks = ((KieContainerInstanceImpl)kci).getKieContainer().getKieSession(); } if (ks != null) { applyListeners(ks); ExecutionResults results = ks.execute(command); return results; } else { throw new IllegalStateException("Session '" + command.getLookup() + "' not found on container '" + kci.getContainerId() + "'."); } } throw new IllegalStateException("Unable to execute command " + command); }
ks = context.getKieSessionLookupManager().lookup(sessionId, kci, context); } else {