Package org.activiti.cdi

Examples of org.activiti.cdi.BusinessProcess


  }

  @Test
  @Deployment(resources = "org/activiti/cdi/test/api/BusinessProcessBeanTest.test.bpmn20.xml")
  public void testResolveTaskBean() {
    BusinessProcess businessProcess = getBeanInstance(BusinessProcess.class);

    assertNull(getBeanInstance(Task.class));
    assertNull(getBeanInstance("taskId"));
   

    businessProcess.startProcessByKey("businessProcessBeanTest");
    String taskId = taskService.createTaskQuery().singleResult().getId();
   
    businessProcess.startTask(taskId);

    // assert that now we can resolve the Task-bean
    assertEquals(taskId, getBeanInstance(Task.class).getId());
    assertEquals(taskId, getBeanInstance("taskId"));
View Full Code Here


public class BusinessProcessContextTest extends CdiActivitiTestCase {

  @Test
  @Deployment
  public void testResolution() throws Exception {
    BusinessProcess businessProcess = getBeanInstance(BusinessProcess.class);

    businessProcess.startProcessByKey("testResolution").getId();

    assertNotNull(getBeanInstance(CreditCard.class));   
  }
View Full Code Here

  @Test
  @Deployment(resources = "org/activiti/cdi/test/api/annotation/CompleteTaskTest.bpmn20.xml")
  public void testCompleteTask() {

    BusinessProcess businessProcess = getBeanInstance(BusinessProcess.class);

    businessProcess.startProcessByKey("keyOfTheProcess");

    Task task = taskService.createTaskQuery().singleResult();
   
    // associate current unit of work with the task:
    businessProcess.startTask(task.getId());

    getBeanInstance(DeclarativeProcessController.class).completeTask();

    // assert that now the task is completed
    assertNull(taskService.createTaskQuery().singleResult());
View Full Code Here

  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();
  }
View Full Code Here

    assertNull(runtimeService.createProcessInstanceQuery().singleResult());

    getBeanInstance(DeclarativeProcessController.class).startProcessByName();

    BusinessProcess businessProcess = getBeanInstance(BusinessProcess.class);

    assertNotNull(runtimeService.createProcessInstanceQuery().singleResult());

    assertEquals("Activiti", businessProcess.getVariable("name"));

    businessProcess.startTask(taskService.createTaskQuery().singleResult().getId())
    businessProcess.completeTask();
  }
View Full Code Here

public class TaskIdTest extends CdiActivitiTestCase {

  @Test
  @Deployment
  public void testTaskIdInjectable() {
    BusinessProcess businessProcess = getBeanInstance(BusinessProcess.class);
    businessProcess.startProcessByKey("keyOfTheProcess")
   
    businessProcess.startTask(taskService.createTaskQuery().singleResult().getId());  
   
    // assert that now the 'taskId'-bean can be looked up
    assertNotNull(getBeanInstance("taskId"));
   
    businessProcess.completeTask();
  }
View Full Code Here

  @Ignore
  @Test
  @Deployment(resources = "org/activiti/cdi/BusinessProcessBeanTest.test.bpmn20.xml")
  public void testResolveString() {
    BusinessProcess businessProcess = getBeanInstance(BusinessProcess.class);

    Map<String, Object> processVariables = new HashMap<String, Object>();
    businessProcess.setVariable("testKeyString", "testValue");
    businessProcess.startProcessByKey("businessProcessBeanTest", processVariables);   
    businessProcess.startTask(taskService.createTaskQuery().singleResult().getId());
   
    InjectProcessVariable injectProcessVariables = getBeanInstance(InjectProcessVariable.class);
    assertEquals("testValue", injectProcessVariables.testKeyString);

    businessProcess.completeTask();
  }
View Full Code Here

TOP

Related Classes of org.activiti.cdi.BusinessProcess

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.