Search in sources :

Example 11 with TestWorkItemHandler

use of org.jbpm.persistence.session.objects.TestWorkItemHandler in project jbpm by kiegroup.

the class DynamicProcessTest method testDynamicProcess.

@Test
public void testDynamicProcess() throws Exception {
    RuleFlowProcessFactory factory = RuleFlowProcessFactory.createProcess("org.jbpm.HelloWorld");
    factory.name("HelloWorldProcess").version("1.0").packageName("org.jbpm").startNode(1).name("Start").done().humanTaskNode(2).name("Task1").actorId("krisv").taskName("MyTask").done().endNode(3).name("End").done().connection(1, 2).connection(2, 3);
    final RuleFlowProcess process = factory.validate().getProcess();
    Resource resource = ResourceFactory.newByteArrayResource(XmlRuleFlowProcessDumper.INSTANCE.dump(process).getBytes());
    // source path or target path must be set to be added into kbase
    resource.setSourcePath("/tmp/dynamicProcess.bpmn2");
    KieBase kbase = createKnowledgeBaseFromResources(resource);
    StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
    TestWorkItemHandler testHandler = new TestWorkItemHandler();
    ksession.getWorkItemManager().registerWorkItemHandler("Human Task", testHandler);
    ksession.addEventListener(new ProcessEventListener() {

        public void beforeVariableChanged(ProcessVariableChangedEvent arg0) {
        }

        public void beforeProcessStarted(ProcessStartedEvent arg0) {
            logger.info("{}", arg0);
        }

        public void beforeProcessCompleted(ProcessCompletedEvent arg0) {
            logger.info("{}", arg0);
        }

        public void beforeNodeTriggered(ProcessNodeTriggeredEvent arg0) {
            logger.info("{}", arg0);
        }

        public void beforeNodeLeft(ProcessNodeLeftEvent arg0) {
            logger.info("{}", arg0);
        }

        public void afterVariableChanged(ProcessVariableChangedEvent arg0) {
        }

        public void afterProcessStarted(ProcessStartedEvent arg0) {
        }

        public void afterProcessCompleted(ProcessCompletedEvent arg0) {
        }

        public void afterNodeTriggered(ProcessNodeTriggeredEvent arg0) {
        }

        public void afterNodeLeft(ProcessNodeLeftEvent arg0) {
        }
    });
    final ProcessInstanceImpl processInstance = (ProcessInstanceImpl) ksession.startProcess("org.jbpm.HelloWorld");
    HumanTaskNode node = new HumanTaskNode();
    node.setName("Task2");
    node.setId(4);
    insertNodeInBetween(process, 2, 3, node);
    ((CommandBasedStatefulKnowledgeSession) ksession).getRunner().execute(new ExecutableCommand<Void>() {

        public Void execute(Context context) {
            StatefulKnowledgeSession ksession = (StatefulKnowledgeSession) ((RegistryContext) context).lookup(KieSession.class);
            ((ProcessInstanceImpl) ksession.getProcessInstance(processInstance.getId())).updateProcess(process);
            return null;
        }
    });
    assertProcessInstanceActive(processInstance);
    ksession.getWorkItemManager().completeWorkItem(testHandler.getWorkItem().getId(), null);
    assertProcessInstanceActive(processInstance);
    ksession.getWorkItemManager().completeWorkItem(testHandler.getWorkItem().getId(), null);
    assertProcessInstanceFinished(processInstance, ksession);
    ksession.dispose();
}
Also used : TestWorkItemHandler(org.jbpm.persistence.session.objects.TestWorkItemHandler) ProcessVariableChangedEvent(org.kie.api.event.process.ProcessVariableChangedEvent) RegistryContext(org.drools.core.command.impl.RegistryContext) Context(org.kie.api.runtime.Context) RuleFlowProcess(org.jbpm.ruleflow.core.RuleFlowProcess) ProcessInstanceImpl(org.jbpm.process.instance.impl.ProcessInstanceImpl) CommandBasedStatefulKnowledgeSession(org.drools.core.command.impl.CommandBasedStatefulKnowledgeSession) StatefulKnowledgeSession(org.kie.internal.runtime.StatefulKnowledgeSession) ProcessEventListener(org.kie.api.event.process.ProcessEventListener) Resource(org.kie.api.io.Resource) ProcessStartedEvent(org.kie.api.event.process.ProcessStartedEvent) RegistryContext(org.drools.core.command.impl.RegistryContext) ProcessCompletedEvent(org.kie.api.event.process.ProcessCompletedEvent) RuleFlowProcessFactory(org.jbpm.ruleflow.core.RuleFlowProcessFactory) KieBase(org.kie.api.KieBase) ProcessNodeTriggeredEvent(org.kie.api.event.process.ProcessNodeTriggeredEvent) ProcessNodeLeftEvent(org.kie.api.event.process.ProcessNodeLeftEvent) HumanTaskNode(org.jbpm.workflow.core.node.HumanTaskNode) Test(org.junit.Test)

Example 12 with TestWorkItemHandler

use of org.jbpm.persistence.session.objects.TestWorkItemHandler in project jbpm by kiegroup.

the class PersistentStatefulSessionTest method testPersistenceVariables.

@Test
public void testPersistenceVariables() {
    KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
    kbuilder.add(new ClassPathResource("VariablesProcess.rf"), ResourceType.DRF);
    for (KnowledgeBuilderError error : kbuilder.getErrors()) {
        logger.debug(error.toString());
    }
    InternalKnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
    kbase.addPackages(kbuilder.getKnowledgePackages());
    StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);
    long id = ksession.getIdentifier();
    Map<String, Object> parameters = new HashMap<String, Object>();
    parameters.put("name", "John Doe");
    ProcessInstance processInstance = ksession.startProcess("org.drools.test.TestProcess", parameters);
    TestWorkItemHandler handler = TestWorkItemHandler.getInstance();
    WorkItem workItem = handler.getWorkItem();
    assertNotNull(workItem);
    assertEquals("John Doe", workItem.getParameter("name"));
    ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(id, kbase, null, env);
    processInstance = ksession.getProcessInstance(processInstance.getId());
    assertNotNull(processInstance);
    ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(id, kbase, null, env);
    ksession.getWorkItemManager().completeWorkItem(workItem.getId(), null);
    workItem = handler.getWorkItem();
    assertNotNull(workItem);
    assertEquals("John Doe", workItem.getParameter("text"));
    ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(id, kbase, null, env);
    processInstance = ksession.getProcessInstance(processInstance.getId());
    assertNotNull(processInstance);
    ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(id, kbase, null, env);
    ksession.getWorkItemManager().completeWorkItem(workItem.getId(), null);
    workItem = handler.getWorkItem();
    assertNull(workItem);
    ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(id, kbase, null, env);
    processInstance = ksession.getProcessInstance(processInstance.getId());
    assertNull(processInstance);
}
Also used : TestWorkItemHandler(org.jbpm.persistence.session.objects.TestWorkItemHandler) KnowledgeBuilderError(org.kie.internal.builder.KnowledgeBuilderError) HashMap(java.util.HashMap) StatefulKnowledgeSession(org.kie.internal.runtime.StatefulKnowledgeSession) WorkItem(org.kie.api.runtime.process.WorkItem) ClassPathResource(org.drools.core.io.impl.ClassPathResource) KnowledgeBuilder(org.kie.internal.builder.KnowledgeBuilder) ProcessInstance(org.kie.api.runtime.process.ProcessInstance) InternalKnowledgeBase(org.drools.core.impl.InternalKnowledgeBase) Test(org.junit.Test) AbstractBaseTest(org.jbpm.test.util.AbstractBaseTest)

Example 13 with TestWorkItemHandler

use of org.jbpm.persistence.session.objects.TestWorkItemHandler in project jbpm by kiegroup.

the class PersistentStatefulSessionTest method testPersistenceEvents.

@Test
public void testPersistenceEvents() {
    KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
    kbuilder.add(new ClassPathResource("EventsProcess.rf"), ResourceType.DRF);
    InternalKnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
    kbase.addPackages(kbuilder.getKnowledgePackages());
    StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);
    long id = ksession.getIdentifier();
    ProcessInstance processInstance = ksession.startProcess("org.drools.test.TestProcess");
    logger.debug("Started process instance {}", processInstance.getId());
    TestWorkItemHandler handler = TestWorkItemHandler.getInstance();
    WorkItem workItem = handler.getWorkItem();
    assertNotNull(workItem);
    ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(id, kbase, null, env);
    processInstance = ksession.getProcessInstance(processInstance.getId());
    assertNotNull(processInstance);
    ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(id, kbase, null, env);
    ksession.getWorkItemManager().completeWorkItem(workItem.getId(), null);
    ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(id, kbase, null, env);
    processInstance = ksession.getProcessInstance(processInstance.getId());
    assertNotNull(processInstance);
    ksession.signalEvent("MyEvent1", null, processInstance.getId());
    ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(id, kbase, null, env);
    processInstance = ksession.getProcessInstance(processInstance.getId());
    assertNotNull(processInstance);
    ksession.signalEvent("MyEvent2", null, processInstance.getId());
    ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(id, kbase, null, env);
    processInstance = ksession.getProcessInstance(processInstance.getId());
    assertNull(processInstance);
}
Also used : TestWorkItemHandler(org.jbpm.persistence.session.objects.TestWorkItemHandler) KnowledgeBuilder(org.kie.internal.builder.KnowledgeBuilder) StatefulKnowledgeSession(org.kie.internal.runtime.StatefulKnowledgeSession) ProcessInstance(org.kie.api.runtime.process.ProcessInstance) WorkItem(org.kie.api.runtime.process.WorkItem) ClassPathResource(org.drools.core.io.impl.ClassPathResource) InternalKnowledgeBase(org.drools.core.impl.InternalKnowledgeBase) Test(org.junit.Test) AbstractBaseTest(org.jbpm.test.util.AbstractBaseTest)

Example 14 with TestWorkItemHandler

use of org.jbpm.persistence.session.objects.TestWorkItemHandler in project jbpm by kiegroup.

the class VariablePersistenceStrategyTest method testPersistenceVariables.

@Test
public void testPersistenceVariables() throws NamingException, NotSupportedException, SystemException, RollbackException, HeuristicMixedException, HeuristicRollbackException {
    EntityManager em = emf.createEntityManager();
    UserTransaction utx = (UserTransaction) new InitialContext().lookup("java:comp/UserTransaction");
    if (utx.getStatus() == Status.STATUS_NO_TRANSACTION) {
        utx.begin();
        em.joinTransaction();
    }
    int origNumMyEntities = em.createQuery("select i from MyEntity i").getResultList().size();
    int origNumMyEntityMethods = em.createQuery("select i from MyEntityMethods i").getResultList().size();
    int origNumMyEntityOnlyFields = em.createQuery("select i from MyEntityOnlyFields i").getResultList().size();
    if (utx.getStatus() == Status.STATUS_ACTIVE) {
        utx.commit();
    }
    // Setup entities
    MyEntity myEntity = new MyEntity("This is a test Entity with annotation in fields");
    MyEntityMethods myEntityMethods = new MyEntityMethods("This is a test Entity with annotations in methods");
    MyEntityOnlyFields myEntityOnlyFields = new MyEntityOnlyFields("This is a test Entity with annotations in fields and without accesors methods");
    MyVariableSerializable myVariableSerializable = new MyVariableSerializable("This is a test SerializableObject");
    // persist entities
    utx = (UserTransaction) new InitialContext().lookup("java:comp/UserTransaction");
    utx.begin();
    em.joinTransaction();
    em.persist(myEntity);
    em.persist(myEntityMethods);
    em.persist(myEntityOnlyFields);
    utx.commit();
    em.close();
    // More setup
    Environment env = createEnvironment();
    KieBase kbase = createKnowledgeBase("VariablePersistenceStrategyProcess.rf");
    KieSession ksession = createSession(kbase, env);
    logger.debug("### Starting process ###");
    Map<String, Object> parameters = new HashMap<String, Object>();
    parameters.put("x", "SomeString");
    parameters.put("y", myEntity);
    parameters.put("m", myEntityMethods);
    parameters.put("f", myEntityOnlyFields);
    parameters.put("z", myVariableSerializable);
    // Start process
    long processInstanceId = ksession.startProcess("com.sample.ruleflow", parameters).getId();
    TestWorkItemHandler handler = TestWorkItemHandler.getInstance();
    WorkItem workItem = handler.getWorkItem();
    assertNotNull(workItem);
    // Test results
    List<?> result = emf.createEntityManager().createQuery("select i from MyEntity i").getResultList();
    assertEquals(origNumMyEntities + 1, result.size());
    result = emf.createEntityManager().createQuery("select i from MyEntityMethods i").getResultList();
    assertEquals(origNumMyEntityMethods + 1, result.size());
    result = emf.createEntityManager().createQuery("select i from MyEntityOnlyFields i").getResultList();
    assertEquals(origNumMyEntityOnlyFields + 1, result.size());
    logger.debug("### Retrieving process instance ###");
    ksession = reloadSession(ksession, kbase, env);
    WorkflowProcessInstance processInstance = (WorkflowProcessInstance) ksession.getProcessInstance(processInstanceId);
    assertNotNull(processInstance);
    assertEquals("SomeString", processInstance.getVariable("x"));
    assertEquals("This is a test Entity with annotation in fields", ((MyEntity) processInstance.getVariable("y")).getTest());
    assertEquals("This is a test Entity with annotations in methods", ((MyEntityMethods) processInstance.getVariable("m")).getTest());
    assertEquals("This is a test Entity with annotations in fields and without accesors methods", ((MyEntityOnlyFields) processInstance.getVariable("f")).test);
    assertEquals("This is a test SerializableObject", ((MyVariableSerializable) processInstance.getVariable("z")).getText());
    assertNull(processInstance.getVariable("a"));
    assertNull(processInstance.getVariable("b"));
    assertNull(processInstance.getVariable("c"));
    logger.debug("### Completing first work item ###");
    ksession.getWorkItemManager().completeWorkItem(workItem.getId(), null);
    workItem = handler.getWorkItem();
    assertNotNull(workItem);
    logger.debug("### Retrieving process instance ###");
    ksession = reloadSession(ksession, kbase, env);
    processInstance = (WorkflowProcessInstance) ksession.getProcessInstance(processInstanceId);
    assertNotNull(processInstance);
    assertEquals("SomeString", processInstance.getVariable("x"));
    assertEquals("This is a test Entity with annotation in fields", ((MyEntity) processInstance.getVariable("y")).getTest());
    assertEquals("This is a test Entity with annotations in methods", ((MyEntityMethods) processInstance.getVariable("m")).getTest());
    assertEquals("This is a test Entity with annotations in fields and without accesors methods", ((MyEntityOnlyFields) processInstance.getVariable("f")).test);
    assertEquals("This is a test SerializableObject", ((MyVariableSerializable) processInstance.getVariable("z")).getText());
    assertEquals("Some new String", processInstance.getVariable("a"));
    assertEquals("This is a new test Entity", ((MyEntity) processInstance.getVariable("b")).getTest());
    assertEquals("This is a new test SerializableObject", ((MyVariableSerializable) processInstance.getVariable("c")).getText());
    logger.debug("### Completing second work item ###");
    ksession.getWorkItemManager().completeWorkItem(workItem.getId(), null);
    workItem = handler.getWorkItem();
    assertNotNull(workItem);
    logger.debug("### Retrieving process instance ###");
    ksession = reloadSession(ksession, kbase, env);
    processInstance = (WorkflowProcessInstance) ksession.getProcessInstance(processInstanceId);
    assertNotNull(processInstance);
    assertEquals("SomeString", processInstance.getVariable("x"));
    assertEquals("This is a test Entity with annotation in fields", ((MyEntity) processInstance.getVariable("y")).getTest());
    assertEquals("This is a test Entity with annotations in methods", ((MyEntityMethods) processInstance.getVariable("m")).getTest());
    assertEquals("This is a test Entity with annotations in fields and without accesors methods", ((MyEntityOnlyFields) processInstance.getVariable("f")).test);
    assertEquals("This is a test SerializableObject", ((MyVariableSerializable) processInstance.getVariable("z")).getText());
    assertEquals("Some changed String", processInstance.getVariable("a"));
    assertEquals("This is a changed test Entity", ((MyEntity) processInstance.getVariable("b")).getTest());
    assertEquals("This is a changed test SerializableObject", ((MyVariableSerializable) processInstance.getVariable("c")).getText());
    logger.debug("### Completing third work item ###");
    ksession.getWorkItemManager().completeWorkItem(workItem.getId(), null);
    workItem = handler.getWorkItem();
    assertNull(workItem);
    ksession = reloadSession(ksession, kbase, env);
    processInstance = (WorkflowProcessInstance) ksession.getProcessInstance(processInstanceId);
    assertNull(processInstance);
}
Also used : UserTransaction(javax.transaction.UserTransaction) MyEntity(org.jbpm.persistence.session.objects.MyEntity) TestWorkItemHandler(org.jbpm.persistence.session.objects.TestWorkItemHandler) HashMap(java.util.HashMap) WorkItem(org.kie.api.runtime.process.WorkItem) InitialContext(javax.naming.InitialContext) MyEntityOnlyFields(org.jbpm.persistence.session.objects.MyEntityOnlyFields) EntityManager(javax.persistence.EntityManager) MyEntityMethods(org.jbpm.persistence.session.objects.MyEntityMethods) KieBase(org.kie.api.KieBase) Environment(org.kie.api.runtime.Environment) KieSession(org.kie.api.runtime.KieSession) MyVariableSerializable(org.jbpm.persistence.session.objects.MyVariableSerializable) WorkflowProcessInstance(org.kie.api.runtime.process.WorkflowProcessInstance) AbstractBaseTest(org.jbpm.test.util.AbstractBaseTest) Test(org.junit.Test)

Example 15 with TestWorkItemHandler

use of org.jbpm.persistence.session.objects.TestWorkItemHandler in project jbpm by kiegroup.

the class VariablePersistenceStrategyTest method testWorkItemWithVariablePersistence.

@Test
public void testWorkItemWithVariablePersistence() throws Exception {
    MyEntity myEntity = new MyEntity("This is a test Entity");
    MyVariableSerializable myVariableSerializable = new MyVariableSerializable("This is a test SerializableObject");
    EntityManager em = emf.createEntityManager();
    UserTransaction utx = (UserTransaction) new InitialContext().lookup("java:comp/UserTransaction");
    utx.begin();
    em.joinTransaction();
    em.persist(myEntity);
    utx.commit();
    em.close();
    Environment env = createEnvironment();
    KieBase kbase = createKnowledgeBase("VPSProcessWithWorkItems.rf");
    KieSession ksession = createSession(kbase, env);
    logger.debug("### Starting process ###");
    Map<String, Object> parameters = new HashMap<String, Object>();
    parameters.put("x", "SomeString");
    parameters.put("y", myEntity);
    parameters.put("z", myVariableSerializable);
    long processInstanceId = ksession.startProcess("com.sample.ruleflow", parameters).getId();
    TestWorkItemHandler handler = TestWorkItemHandler.getInstance();
    WorkItem workItem = handler.getWorkItem();
    assertNotNull(workItem);
    logger.debug("### Retrieving process instance ###");
    ksession = reloadSession(ksession, kbase, env);
    WorkflowProcessInstance processInstance = (WorkflowProcessInstance) ksession.getProcessInstance(processInstanceId);
    assertNotNull(processInstance);
    assertEquals("SomeString", processInstance.getVariable("x"));
    assertEquals("This is a test Entity", ((MyEntity) processInstance.getVariable("y")).getTest());
    assertEquals("This is a test SerializableObject", ((MyVariableSerializable) processInstance.getVariable("z")).getText());
    assertNull(processInstance.getVariable("a"));
    assertNull(processInstance.getVariable("b"));
    assertNull(processInstance.getVariable("c"));
    logger.debug("### Completing first work item ###");
    Map<String, Object> results = new HashMap<String, Object>();
    results.put("zeta", processInstance.getVariable("z"));
    results.put("equis", processInstance.getVariable("x") + "->modifiedResult");
    ksession.getWorkItemManager().completeWorkItem(workItem.getId(), results);
    workItem = handler.getWorkItem();
    assertNotNull(workItem);
    logger.debug("### Retrieving process instance ###");
    ksession = reloadSession(ksession, kbase, env);
    processInstance = (WorkflowProcessInstance) ksession.getProcessInstance(processInstanceId);
    assertNotNull(processInstance);
    logger.debug("######## Getting the already Persisted Variables #########");
    assertEquals("SomeString->modifiedResult", processInstance.getVariable("x"));
    assertEquals("This is a test Entity", ((MyEntity) processInstance.getVariable("y")).getTest());
    assertEquals("This is a test SerializableObject", ((MyVariableSerializable) processInstance.getVariable("z")).getText());
    assertEquals("Some new String", processInstance.getVariable("a"));
    assertEquals("This is a new test Entity", ((MyEntity) processInstance.getVariable("b")).getTest());
    assertEquals("This is a new test SerializableObject", ((MyVariableSerializable) processInstance.getVariable("c")).getText());
    logger.debug("### Completing second work item ###");
    results = new HashMap<String, Object>();
    results.put("zeta", processInstance.getVariable("z"));
    results.put("equis", processInstance.getVariable("x"));
    ksession.getWorkItemManager().completeWorkItem(workItem.getId(), results);
    workItem = handler.getWorkItem();
    assertNotNull(workItem);
    logger.debug("### Retrieving process instance ###");
    ksession = reloadSession(ksession, kbase, env);
    processInstance = (WorkflowProcessInstance) ksession.getProcessInstance(processInstanceId);
    assertNotNull(processInstance);
    assertEquals("SomeString->modifiedResult", processInstance.getVariable("x"));
    assertEquals("This is a test Entity", ((MyEntity) processInstance.getVariable("y")).getTest());
    assertEquals("This is a test SerializableObject", ((MyVariableSerializable) processInstance.getVariable("z")).getText());
    assertEquals("Some changed String", processInstance.getVariable("a"));
    assertEquals("This is a changed test Entity", ((MyEntity) processInstance.getVariable("b")).getTest());
    assertEquals("This is a changed test SerializableObject", ((MyVariableSerializable) processInstance.getVariable("c")).getText());
    logger.debug("### Completing third work item ###");
    results = new HashMap<String, Object>();
    results.put("zeta", processInstance.getVariable("z"));
    results.put("equis", processInstance.getVariable("x"));
    ksession.getWorkItemManager().completeWorkItem(workItem.getId(), results);
    workItem = handler.getWorkItem();
    assertNull(workItem);
    ksession = reloadSession(ksession, kbase, env);
    processInstance = (WorkflowProcessInstance) ksession.getProcessInstance(processInstanceId);
    assertNull(processInstance);
}
Also used : MyEntity(org.jbpm.persistence.session.objects.MyEntity) UserTransaction(javax.transaction.UserTransaction) TestWorkItemHandler(org.jbpm.persistence.session.objects.TestWorkItemHandler) HashMap(java.util.HashMap) WorkItem(org.kie.api.runtime.process.WorkItem) InitialContext(javax.naming.InitialContext) EntityManager(javax.persistence.EntityManager) KieBase(org.kie.api.KieBase) Environment(org.kie.api.runtime.Environment) KieSession(org.kie.api.runtime.KieSession) MyVariableSerializable(org.jbpm.persistence.session.objects.MyVariableSerializable) WorkflowProcessInstance(org.kie.api.runtime.process.WorkflowProcessInstance) AbstractBaseTest(org.jbpm.test.util.AbstractBaseTest) Test(org.junit.Test)

Aggregations

TestWorkItemHandler (org.jbpm.persistence.session.objects.TestWorkItemHandler)16 Test (org.junit.Test)16 AbstractBaseTest (org.jbpm.test.util.AbstractBaseTest)13 WorkItem (org.kie.api.runtime.process.WorkItem)13 ProcessInstance (org.kie.api.runtime.process.ProcessInstance)11 InternalKnowledgeBase (org.drools.core.impl.InternalKnowledgeBase)8 KieBase (org.kie.api.KieBase)8 StatefulKnowledgeSession (org.kie.internal.runtime.StatefulKnowledgeSession)8 InitialContext (javax.naming.InitialContext)7 UserTransaction (javax.transaction.UserTransaction)7 HashMap (java.util.HashMap)6 EntityManager (javax.persistence.EntityManager)5 ClassPathResource (org.drools.core.io.impl.ClassPathResource)5 MyEntity (org.jbpm.persistence.session.objects.MyEntity)5 MyVariableSerializable (org.jbpm.persistence.session.objects.MyVariableSerializable)5 Environment (org.kie.api.runtime.Environment)5 KieSession (org.kie.api.runtime.KieSession)5 WorkflowProcessInstance (org.kie.api.runtime.process.WorkflowProcessInstance)5 KnowledgeBuilder (org.kie.internal.builder.KnowledgeBuilder)5 Properties (java.util.Properties)3