Search in sources :

Example 6 with ProcessPersistenceContextManager

use of org.jbpm.persistence.api.ProcessPersistenceContextManager in project jbpm by kiegroup.

the class JPAProcessInstanceManager method getProcessInstance.

@Override
public ProcessInstance getProcessInstance(CorrelationKey correlationKey) {
    ProcessPersistenceContext context = ((ProcessPersistenceContextManager) this.kruntime.getEnvironment().get(EnvironmentName.PERSISTENCE_CONTEXT_MANAGER)).getProcessPersistenceContext();
    Long processInstanceId = context.getProcessInstanceByCorrelationKey(correlationKey);
    if (processInstanceId == null) {
        return null;
    }
    return getProcessInstance(processInstanceId);
}
Also used : ProcessPersistenceContextManager(org.jbpm.persistence.api.ProcessPersistenceContextManager) ProcessPersistenceContext(org.jbpm.persistence.api.ProcessPersistenceContext)

Aggregations

ProcessPersistenceContext (org.jbpm.persistence.api.ProcessPersistenceContext)6 ProcessPersistenceContextManager (org.jbpm.persistence.api.ProcessPersistenceContextManager)6 ProcessInstanceView (org.jbpm.persistence.api.integration.model.ProcessInstanceView)3 ArrayList (java.util.ArrayList)1 List (java.util.List)1 EntityManagerFactory (javax.persistence.EntityManagerFactory)1 SingleSessionCommandService (org.drools.core.command.SingleSessionCommandService)1 CommandBasedStatefulKnowledgeSession (org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession)1 ExecutableCommand (org.drools.core.command.impl.ExecutableCommand)1 RegistryContext (org.drools.core.command.impl.RegistryContext)1 InternalKnowledgeRuntime (org.drools.core.common.InternalKnowledgeRuntime)1 TransactionManager (org.drools.persistence.api.TransactionManager)1 RequirePersistence (org.jbpm.bpmn2.test.RequirePersistence)1 CorrelationKeyInfo (org.jbpm.persistence.correlation.CorrelationKeyInfo)1 CorrelationPropertyInfo (org.jbpm.persistence.correlation.CorrelationPropertyInfo)1 AsyncSignalEventCommand (org.jbpm.process.core.async.AsyncSignalEventCommand)1 ProcessInstanceImpl (org.jbpm.process.instance.impl.ProcessInstanceImpl)1 DoNothingWorkItemHandler (org.jbpm.process.instance.impl.demo.DoNothingWorkItemHandler)1 WorkflowProcessInstanceImpl (org.jbpm.workflow.instance.impl.WorkflowProcessInstanceImpl)1 Test (org.junit.Test)1