Search in sources :

Example 1 with TaskServiceFactory

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;
}
Also used : InMemorySessionFactory(org.jbpm.runtime.manager.impl.factory.InMemorySessionFactory) SessionFactory(org.kie.internal.runtime.manager.SessionFactory) JPASessionFactory(org.jbpm.runtime.manager.impl.factory.JPASessionFactory) LocalTaskServiceFactory(org.jbpm.runtime.manager.impl.factory.LocalTaskServiceFactory) TaskServiceFactory(org.kie.internal.runtime.manager.TaskServiceFactory) RuntimeManager(org.kie.api.runtime.manager.RuntimeManager)

Example 2 with TaskServiceFactory

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;
}
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 3 with 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;
}
Also used : InMemorySessionFactory(org.jbpm.runtime.manager.impl.factory.InMemorySessionFactory) SessionFactory(org.kie.internal.runtime.manager.SessionFactory) JPASessionFactory(org.jbpm.runtime.manager.impl.factory.JPASessionFactory) LocalTaskServiceFactory(org.jbpm.runtime.manager.impl.factory.LocalTaskServiceFactory) TaskServiceFactory(org.kie.internal.runtime.manager.TaskServiceFactory) RuntimeManager(org.kie.api.runtime.manager.RuntimeManager)

Example 4 with TaskServiceFactory

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;
}
Also used : InMemorySessionFactory(org.jbpm.runtime.manager.impl.factory.InMemorySessionFactory) SessionFactory(org.kie.internal.runtime.manager.SessionFactory) JPASessionFactory(org.jbpm.runtime.manager.impl.factory.JPASessionFactory) LocalTaskServiceFactory(org.jbpm.runtime.manager.impl.factory.LocalTaskServiceFactory) TaskServiceFactory(org.kie.internal.runtime.manager.TaskServiceFactory) RuntimeManager(org.kie.api.runtime.manager.RuntimeManager)

Example 5 with TaskServiceFactory

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;
}
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

TaskServiceFactory (org.kie.internal.runtime.manager.TaskServiceFactory)8 LocalTaskServiceFactory (org.jbpm.runtime.manager.impl.factory.LocalTaskServiceFactory)6 RuntimeManager (org.kie.api.runtime.manager.RuntimeManager)5 InMemorySessionFactory (org.jbpm.runtime.manager.impl.factory.InMemorySessionFactory)4 JPASessionFactory (org.jbpm.runtime.manager.impl.factory.JPASessionFactory)4 SessionFactory (org.kie.internal.runtime.manager.SessionFactory)4 EntityManagerFactory (javax.persistence.EntityManagerFactory)2 KieSession (org.kie.api.runtime.KieSession)2 RuntimeEngine (org.kie.api.runtime.manager.RuntimeEngine)2 RuntimeEnvironment (org.kie.api.runtime.manager.RuntimeEnvironment)2 HashMap (java.util.HashMap)1 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)1 SimpleRuntimeEnvironment (org.jbpm.runtime.manager.impl.SimpleRuntimeEnvironment)1 HumanTaskServiceFactory (org.jbpm.services.task.HumanTaskServiceFactory)1 JPATaskLifeCycleEventListener (org.jbpm.services.task.audit.JPATaskLifeCycleEventListener)1 AbstractBaseTest (org.jbpm.test.util.AbstractBaseTest)1 Test (org.junit.Test)1 ProcessInstance (org.kie.api.runtime.process.ProcessInstance)1 TaskService (org.kie.api.task.TaskService)1