Search in sources :

Example 1 with LocalTaskServiceFactory

use of org.jbpm.runtime.manager.impl.factory.LocalTaskServiceFactory 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;
}
Also used : LocalTaskServiceFactory(org.jbpm.runtime.manager.impl.factory.LocalTaskServiceFactory) TaskServiceFactory(org.kie.internal.runtime.manager.TaskServiceFactory) LocalTaskServiceFactory(org.jbpm.runtime.manager.impl.factory.LocalTaskServiceFactory)

Example 2 with LocalTaskServiceFactory

use of org.jbpm.runtime.manager.impl.factory.LocalTaskServiceFactory 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;
}
Also used : SimpleRuntimeEnvironment(org.jbpm.runtime.manager.impl.SimpleRuntimeEnvironment) LocalTaskServiceFactory(org.jbpm.runtime.manager.impl.factory.LocalTaskServiceFactory) TaskServiceFactory(org.kie.internal.runtime.manager.TaskServiceFactory) LocalTaskServiceFactory(org.jbpm.runtime.manager.impl.factory.LocalTaskServiceFactory)

Aggregations

LocalTaskServiceFactory (org.jbpm.runtime.manager.impl.factory.LocalTaskServiceFactory)2 TaskServiceFactory (org.kie.internal.runtime.manager.TaskServiceFactory)2 SimpleRuntimeEnvironment (org.jbpm.runtime.manager.impl.SimpleRuntimeEnvironment)1