Package org.activiti.engine

Examples of org.activiti.engine.TaskService.createTaskQuery()


    // Completing the task using the predefined process variable (normally done through the form)
    TaskService taskService = activitiRule.getTaskService();
    taskService.complete(task.getId(), CollectionUtil.singletonMap(FeedbackStepDefinitionConverter.VARIABLE_FEEDBACK_PROVIDERS, Arrays.asList("gonzo", "fozzie")));
   
    // Three tasks should be available now
    assertEquals(3, taskService.createTaskQuery().count());
    assertEquals(1, taskService.createTaskQuery().taskAssignee("kermit").count());
    assertEquals(1, taskService.createTaskQuery().taskAssignee("gonzo").count());
    assertEquals(1, taskService.createTaskQuery().taskAssignee("fozzie").count());
   
    // Completing the feedback tasks first should only leave the 'gather feedback' task for kermit open
View Full Code Here


    TaskService taskService = activitiRule.getTaskService();
    taskService.complete(task.getId(), CollectionUtil.singletonMap(FeedbackStepDefinitionConverter.VARIABLE_FEEDBACK_PROVIDERS, Arrays.asList("gonzo", "fozzie")));
   
    // Three tasks should be available now
    assertEquals(3, taskService.createTaskQuery().count());
    assertEquals(1, taskService.createTaskQuery().taskAssignee("kermit").count());
    assertEquals(1, taskService.createTaskQuery().taskAssignee("gonzo").count());
    assertEquals(1, taskService.createTaskQuery().taskAssignee("fozzie").count());
   
    // Completing the feedback tasks first should only leave the 'gather feedback' task for kermit open
    for (Task feedbackTask : taskService.createTaskQuery().list()) {
View Full Code Here

    taskService.complete(task.getId(), CollectionUtil.singletonMap(FeedbackStepDefinitionConverter.VARIABLE_FEEDBACK_PROVIDERS, Arrays.asList("gonzo", "fozzie")));
   
    // Three tasks should be available now
    assertEquals(3, taskService.createTaskQuery().count());
    assertEquals(1, taskService.createTaskQuery().taskAssignee("kermit").count());
    assertEquals(1, taskService.createTaskQuery().taskAssignee("gonzo").count());
    assertEquals(1, taskService.createTaskQuery().taskAssignee("fozzie").count());
   
    // Completing the feedback tasks first should only leave the 'gather feedback' task for kermit open
    for (Task feedbackTask : taskService.createTaskQuery().list()) {
      if (!feedbackTask.getAssignee().equals("kermit")) {
View Full Code Here

   
    // Three tasks should be available now
    assertEquals(3, taskService.createTaskQuery().count());
    assertEquals(1, taskService.createTaskQuery().taskAssignee("kermit").count());
    assertEquals(1, taskService.createTaskQuery().taskAssignee("gonzo").count());
    assertEquals(1, taskService.createTaskQuery().taskAssignee("fozzie").count());
   
    // Completing the feedback tasks first should only leave the 'gather feedback' task for kermit open
    for (Task feedbackTask : taskService.createTaskQuery().list()) {
      if (!feedbackTask.getAssignee().equals("kermit")) {
        activitiRule.getTaskService().complete(feedbackTask.getId());
View Full Code Here

    assertEquals(1, taskService.createTaskQuery().taskAssignee("kermit").count());
    assertEquals(1, taskService.createTaskQuery().taskAssignee("gonzo").count());
    assertEquals(1, taskService.createTaskQuery().taskAssignee("fozzie").count());
   
    // Completing the feedback tasks first should only leave the 'gather feedback' task for kermit open
    for (Task feedbackTask : taskService.createTaskQuery().list()) {
      if (!feedbackTask.getAssignee().equals("kermit")) {
        activitiRule.getTaskService().complete(feedbackTask.getId());
      }
    }
    assertEquals(1, taskService.createTaskQuery().count());
View Full Code Here

    for (Task feedbackTask : taskService.createTaskQuery().list()) {
      if (!feedbackTask.getAssignee().equals("kermit")) {
        activitiRule.getTaskService().complete(feedbackTask.getId());
      }
    }
    assertEquals(1, taskService.createTaskQuery().count());
    assertEquals(1, taskService.createTaskQuery().taskAssignee("kermit").count());
   
    // Completing this last task should finish the process
    activitiRule.getTaskService().complete(activitiRule.getTaskService().createTaskQuery().singleResult().getId());
    assertEquals(0, activitiRule.getRuntimeService().createProcessInstanceQuery().count());
View Full Code Here

      if (!feedbackTask.getAssignee().equals("kermit")) {
        activitiRule.getTaskService().complete(feedbackTask.getId());
      }
    }
    assertEquals(1, taskService.createTaskQuery().count());
    assertEquals(1, taskService.createTaskQuery().taskAssignee("kermit").count());
   
    // Completing this last task should finish the process
    activitiRule.getTaskService().complete(activitiRule.getTaskService().createTaskQuery().singleResult().getId());
    assertEquals(0, activitiRule.getRuntimeService().createProcessInstanceQuery().count());
  }
View Full Code Here

    
     assertNotNull(processInstance);
    
     // Complete the task.  That will end the process instance
     TaskService taskService = processEngine.getTaskService();
     Task task = taskService
       .createTaskQuery()
       .list()
       .get(0);
     taskService.complete(task.getId());
    
View Full Code Here

      .getId();
   
    // Start process instance on second engine
    String processDefinitionId = repositoryService2.createProcessDefinitionQuery().singleResult().getId();
    runtimeService2.startProcessInstanceById(processDefinitionId);
    Task task = taskService2.createTaskQuery().singleResult();
    assertEquals("original task", task.getName());
   
    // Delete the deployment on second process engine
    repositoryService2.deleteDeployment(deploymentId, true);
    assertEquals(0, repositoryService2.createDeploymentQuery().count());
View Full Code Here

      .getId();
   
    // Start process instance on second process engine -> must use revised process definition
    repositoryService2.createProcessDefinitionQuery().singleResult().getId();
    runtimeService2.startProcessInstanceByKey("oneTaskProcess");
    task = taskService2.createTaskQuery().singleResult();
    assertEquals("revised task", task.getName());
   
    // cleanup
    repositoryService1.deleteDeployment(deploymentId, true);
    processEngine1.close();
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.