use of org.kie.internal.runtime.manager.TaskServiceFactory in project jbpm by kiegroup.
the class RuntimeManagerFactoryImpl method newPerProcessInstanceRuntimeManager.
public RuntimeManager newPerProcessInstanceRuntimeManager(RuntimeEnvironment environment, String identifier) {
SessionFactory factory = getSessionFactory(environment, identifier);
TaskServiceFactory taskServiceFactory = getTaskServiceFactory(environment);
RuntimeManager manager = new PerProcessInstanceRuntimeManager(environment, factory, taskServiceFactory, identifier);
initTimerService(environment, manager);
((AbstractRuntimeManager) manager).init();
return manager;
}
use of org.kie.internal.runtime.manager.TaskServiceFactory in project jbpm by kiegroup.
the class RuntimeManagerFactoryImpl method getTaskServiceFactory.
protected TaskServiceFactory getTaskServiceFactory(RuntimeEnvironment environment) {
// if there is an implementation of TaskServiceFactory in the environment then use it
TaskServiceFactory taskServiceFactory = (TaskServiceFactory) ((SimpleRuntimeEnvironment) environment).getEnvironmentTemplate().get("org.kie.internal.runtime.manager.TaskServiceFactory");
if (taskServiceFactory != null) {
return taskServiceFactory;
}
taskServiceFactory = new LocalTaskServiceFactory(environment);
return taskServiceFactory;
}
use of org.kie.internal.runtime.manager.TaskServiceFactory in project jbpm by kiegroup.
the class RuntimeManagerFactoryImpl method newPerRequestRuntimeManager.
public RuntimeManager newPerRequestRuntimeManager(RuntimeEnvironment environment, String identifier) {
SessionFactory factory = getSessionFactory(environment, identifier);
TaskServiceFactory taskServiceFactory = getTaskServiceFactory(environment);
RuntimeManager manager = new PerRequestRuntimeManager(environment, factory, taskServiceFactory, identifier);
initTimerService(environment, manager);
((AbstractRuntimeManager) manager).init();
return manager;
}
use of org.kie.internal.runtime.manager.TaskServiceFactory in project jbpm by kiegroup.
the class RuntimeManagerFactoryImpl method newPerCaseRuntimeManager.
public RuntimeManager newPerCaseRuntimeManager(RuntimeEnvironment environment, String identifier) {
SessionFactory factory = getSessionFactory(environment, identifier);
TaskServiceFactory taskServiceFactory = getTaskServiceFactory(environment);
RuntimeManager manager = new PerCaseRuntimeManager(environment, factory, taskServiceFactory, identifier);
initTimerService(environment, manager);
((AbstractRuntimeManager) manager).init();
return manager;
}
use of org.kie.internal.runtime.manager.TaskServiceFactory in project jbpm by kiegroup.
the class RuntimeManagerFactoryCDIImpl method getTaskServiceFactory.
@Override
protected TaskServiceFactory getTaskServiceFactory(RuntimeEnvironment environment) {
// if there is an implementation of TaskServiceFactory in the environment then use it
TaskServiceFactory taskServiceFactory = (TaskServiceFactory) ((SimpleRuntimeEnvironment) environment).getEnvironmentTemplate().get("org.kie.internal.runtime.manager.TaskServiceFactory");
if (taskServiceFactory != null) {
return taskServiceFactory;
}
try {
taskServiceFactory = taskServiceFactoryInjected.get();
// since this is CDI let's make sure it has all dependencies met
taskServiceFactory.newTaskService().toString();
} catch (Exception e) {
taskServiceFactory = new LocalTaskServiceFactory(environment);
}
return taskServiceFactory;
}
Aggregations