use of org.kie.internal.runtime.manager.GlobalProducer in project jbpm by kiegroup.
the class InjectableRegisterableItemsFactory method getGlobals.
@Override
public Map<String, Object> getGlobals(RuntimeEngine runtime) {
Map<String, Object> globals = new HashMap<String, Object>();
RuntimeManager manager = ((RuntimeEngineImpl) runtime).getManager();
Map<String, Object> parameters = new HashMap<String, Object>();
parameters.put("ksession", runtime.getKieSession());
parameters.put("taskService", runtime.getTaskService());
parameters.put("runtimeManager", manager);
parameters.put("kieContainer", getRuntimeManager().getKieContainer());
try {
parameters.put("executorService", executorService.get());
} catch (Exception e) {
logger.debug("Executor service not available due to {}", e.getMessage());
}
try {
for (GlobalProducer producer : globalProducer) {
globals.putAll(producer.getGlobals(manager.getIdentifier(), parameters));
}
} catch (Exception e) {
// do nothing as work item handler is considered optional
logger.warn("Exception while evalutating globals prodcuers {}", e.getMessage());
}
// add globals from descriptor
globals.putAll(getGlobalsFromDescriptor(runtime));
return globals;
}
Aggregations