Search in sources :

Example 11 with BusinessProcess

use of org.activiti.cdi.BusinessProcess in project Activiti by Activiti.

the class StartProcessTest method testStartProcessByKey.

@Test
@Deployment(resources = "org/activiti/cdi/test/api/annotation/StartProcessTest.bpmn20.xml")
public void testStartProcessByKey() {
    assertNull(runtimeService.createProcessInstanceQuery().singleResult());
    getBeanInstance(DeclarativeProcessController.class).startProcessByKey();
    BusinessProcess businessProcess = getBeanInstance(BusinessProcess.class);
    assertNotNull(runtimeService.createProcessInstanceQuery().singleResult());
    assertEquals("Activiti", businessProcess.getVariable("name"));
    businessProcess.startTask(taskService.createTaskQuery().singleResult().getId());
    businessProcess.completeTask();
}
Also used : DeclarativeProcessController(org.activiti.cdi.test.impl.beans.DeclarativeProcessController) BusinessProcess(org.activiti.cdi.BusinessProcess) Test(org.junit.Test) Deployment(org.activiti.engine.test.Deployment)

Example 12 with BusinessProcess

use of org.activiti.cdi.BusinessProcess in project Activiti by Activiti.

the class BusinessProcessContextTest method testResolution.

@Test
@Deployment
public void testResolution() throws Exception {
    BusinessProcess businessProcess = getBeanInstance(BusinessProcess.class);
    businessProcess.startProcessByKey("testResolution").getId();
    assertNotNull(getBeanInstance(CreditCard.class));
}
Also used : CreditCard(org.activiti.cdi.test.impl.beans.CreditCard) BusinessProcess(org.activiti.cdi.BusinessProcess) Test(org.junit.Test) Deployment(org.activiti.engine.test.Deployment)

Aggregations

BusinessProcess (org.activiti.cdi.BusinessProcess)12 Deployment (org.activiti.engine.test.Deployment)10 Test (org.junit.Test)10 DeclarativeProcessController (org.activiti.cdi.test.impl.beans.DeclarativeProcessController)3 Task (org.activiti.engine.task.Task)3 Bean (javax.enterprise.inject.spi.Bean)2 HashMap (java.util.HashMap)1 CreditCard (org.activiti.cdi.test.impl.beans.CreditCard)1 Execution (org.activiti.engine.runtime.Execution)1 ProcessInstance (org.activiti.engine.runtime.ProcessInstance)1 Ignore (org.junit.Ignore)1