Package org.activiti.engine.task

Examples of org.activiti.engine.task.TaskQuery.singleResult()


    // Completing the task continues the process which leads to calling the
    // subprocess. The sub process we want to call is passed in as a variable
    // into this task
    taskService.setVariable(taskBeforeSubProcess.getId(), "simpleSubProcessExpression", "simpleSubProcess");
    taskService.complete(taskBeforeSubProcess.getId());
    Task taskInSubProcess = taskQuery.singleResult();
    assertEquals("Task in subprocess", taskInSubProcess.getName());

    // Completing the task in the subprocess, finishes the subprocess
    taskService.complete(taskInSubProcess.getId());
    Task taskAfterSubProcess = taskQuery.singleResult();
View Full Code Here


    Task taskInSubProcess = taskQuery.singleResult();
    assertEquals("Task in subprocess", taskInSubProcess.getName());

    // Completing the task in the subprocess, finishes the subprocess
    taskService.complete(taskInSubProcess.getId());
    Task taskAfterSubProcess = taskQuery.singleResult();
    assertEquals("Task after subprocess", taskAfterSubProcess.getName());

    // Completing this task end the process instance
    taskService.complete(taskAfterSubProcess.getId());
    assertProcessEnded(processInstance.getId());
View Full Code Here

  public void testSubProcessEndsSuperProcess() {
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("subProcessEndsSuperProcess");
   
    // one task in the subprocess should be active after starting the process instance
    TaskQuery taskQuery = taskService.createTaskQuery();
    Task taskBeforeSubProcess = taskQuery.singleResult();
    assertEquals("Task in subprocess", taskBeforeSubProcess.getName());
   
    // Completing this task ends the subprocess which leads to the end of the whole process instance
    taskService.complete(taskBeforeSubProcess.getId());
    assertProcessEnded(processInstance.getId());
View Full Code Here

      // FIRST sub process calls simpleSubProcess
     
      // one task in the subprocess should be active after starting the process
      // instance
      TaskQuery taskQuery = taskService.createTaskQuery();
      Task taskBeforeSubProcess = taskQuery.singleResult();
      assertEquals("Task before subprocess", taskBeforeSubProcess.getName());

      // Completing the task continues the process which leads to calling the
      // subprocess. The sub process we want to call is passed in as a variable
      // into this task
View Full Code Here

      // Completing the task continues the process which leads to calling the
      // subprocess. The sub process we want to call is passed in as a variable
      // into this task
      taskService.setVariable(taskBeforeSubProcess.getId(), "simpleSubProcessExpression", "simpleSubProcess");
      taskService.complete(taskBeforeSubProcess.getId());
      Task taskInSubProcess = taskQuery.singleResult();
      assertEquals("Task in subprocess", taskInSubProcess.getName());

      // Completing the task in the subprocess, finishes the subprocess
      taskService.complete(taskInSubProcess.getId());
      Task taskAfterSubProcess = taskQuery.singleResult();
View Full Code Here

      Task taskInSubProcess = taskQuery.singleResult();
      assertEquals("Task in subprocess", taskInSubProcess.getName());

      // Completing the task in the subprocess, finishes the subprocess
      taskService.complete(taskInSubProcess.getId());
      Task taskAfterSubProcess = taskQuery.singleResult();
      assertEquals("Task after subprocess", taskAfterSubProcess.getName());

      // Completing this task end the process instance
      taskService.complete(taskAfterSubProcess.getId());
     
View Full Code Here

      // SECOND sub process calls simpleSubProcess2
     
      // one task in the subprocess should be active after starting the process
      // instance
      taskQuery = taskService.createTaskQuery();
      taskBeforeSubProcess = taskQuery.singleResult();
      assertEquals("Task before subprocess", taskBeforeSubProcess.getName());

      // Completing the task continues the process which leads to calling the
      // subprocess. The sub process we want to call is passed in as a variable
      // into this task
View Full Code Here

      // Completing the task continues the process which leads to calling the
      // subprocess. The sub process we want to call is passed in as a variable
      // into this task
      taskService.setVariable(taskBeforeSubProcess.getId(), "simpleSubProcessExpression", "simpleSubProcess2");
      taskService.complete(taskBeforeSubProcess.getId());
      taskInSubProcess = taskQuery.singleResult();
      assertEquals("Task in subprocess 2", taskInSubProcess.getName());

      // Completing the task in the subprocess, finishes the subprocess
      taskService.complete(taskInSubProcess.getId());
      taskAfterSubProcess = taskQuery.singleResult();
View Full Code Here

      taskInSubProcess = taskQuery.singleResult();
      assertEquals("Task in subprocess 2", taskInSubProcess.getName());

      // Completing the task in the subprocess, finishes the subprocess
      taskService.complete(taskInSubProcess.getId());
      taskAfterSubProcess = taskQuery.singleResult();
      assertEquals("Task after subprocess", taskAfterSubProcess.getName());

      // Completing this task end the process instance
      taskService.complete(taskAfterSubProcess.getId());
      assertProcessEnded(processInstance.getId());
View Full Code Here

    Date startTime = ClockUtil.getCurrentTime();
   
    // After process start, the task in the subprocess should be active
    runtimeService.startProcessInstanceByKey("timerOnCallActivity");
    TaskQuery taskQuery = taskService.createTaskQuery();
    Task taskInSubProcess = taskQuery.singleResult();
    assertEquals("Task in subprocess", taskInSubProcess.getName());
   
    // When the timer on the subprocess is fired, the complete subprocess is destroyed
    ClockUtil.setCurrentTime(new Date(startTime.getTime() + (6 * 60 * 1000))); // + 6 minutes, timer fires on 5 minutes
    waitForJobExecutorToProcessAllJobs(10000, 100);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.