Package org.activiti.engine

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


    users.add("user3");

    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("users", users);

    taskService.complete(task.getId(), variables);

    for (String string : users) {
      assertEquals(1, taskService.createTaskQuery().taskAssignee(string).count());
    }
  }
View Full Code Here


    TaskService taskService = engineServices.getTaskService();
    List<IdentityLink> identityLinksForTask = taskService.getIdentityLinksForTask(delegateTask.getId());
    for (IdentityLink identityLink : identityLinksForTask) {
      taskService.deleteCandidateGroup(delegateTask.getId(), identityLink.getGroupId());
    }
    taskService.complete(delegateTask.getId());
  }

  // @Override
  // public void execute(ActivityExecution execution) throws Exception {
  // TaskService taskService = execution.getEngineServices().getTaskService();
View Full Code Here

    System.out.println("id " + processInstance.getId() + " " + processInstance.getProcessDefinitionId());
   
    TaskService taskService = activitiRule.getTaskService();
    Task singleResult = taskService.createTaskQuery().singleResult();
    identityService.setAuthenticatedUserId("henryyan");
    taskService.complete(singleResult.getId());
   
    long count = activitiRule.getHistoryService().createHistoricProcessInstanceQuery().count();
    assertEquals(2, count);
   
    List<HistoricProcessInstance> list = activitiRule.getHistoryService().createHistoricProcessInstanceQuery().list();
View Full Code Here

    for (Task task : list) {
      System.out.println(ToStringBuilder.reflectionToString(task));
    }
    variableMap = new HashMap<String, Object>();
    variableMap.put("pass", false);
    taskService.complete(list.get(0).getId(), variableMap);
    System.out.println("A completed");
    taskAssignee = taskService.createTaskQuery().taskAssignee("1");
    list = taskAssignee.list();
    assertEquals(1, list.size());
    assertEquals("C", list.get(0).getName());
View Full Code Here

   
    TaskService taskService = processEngine.getTaskService();
    Task task = taskService.createTaskQuery().singleResult();
    assertNotNull(task);
   
    taskService.complete(task.getId());
    Thread.sleep(2000);
    System.exit(0);
  }
 
  public static void main(String[] args) throws Exception {
View Full Code Here

    // 验证有两个用户任务
    List<Task> list = taskService.createTaskQuery().list();
    assertEquals(2, list.size());
   
    // 完成两个用户任务
    taskService.complete(list.get(0).getId());
    taskService.complete(list.get(1).getId());
   
    // 验证有两个正常运行的实例
    List<HistoricProcessInstance> list2 = activitiRule.getHistoryService().createHistoricProcessInstanceQuery().unfinished().list();
    assertEquals(2, list2.size());
View Full Code Here

    List<Task> list = taskService.createTaskQuery().list();
    assertEquals(2, list.size());
   
    // 完成两个用户任务
    taskService.complete(list.get(0).getId());
    taskService.complete(list.get(1).getId());
   
    // 验证有两个正常运行的实例
    List<HistoricProcessInstance> list2 = activitiRule.getHistoryService().createHistoricProcessInstanceQuery().unfinished().list();
    assertEquals(2, list2.size());
   
View Full Code Here

    Task task = taskService.createTaskQuery().singleResult();
    variableMap = new HashMap<String, Object>();
    for (int i = 0; i < 5; i++) {
      variableMap.put("task1-variable" + (i + 1), "task1-value" + (i + 1));
    }
    taskService.complete(task.getId(), variableMap);

    // 执行第二个任务
    task = taskService.createTaskQuery().singleResult();
    variableMap = new HashMap<String, Object>();
    for (int i = 0; i < 5; i++) {
View Full Code Here

    task = taskService.createTaskQuery().singleResult();
    variableMap = new HashMap<String, Object>();
    for (int i = 0; i < 5; i++) {
      variableMap.put("task2-variable" + (i + 1), "task2-value" + (i + 1));
    }
    taskService.complete(task.getId(), variableMap);

    // Map<历史活动ID, Map<变量名称, 变量值>>
    Map<String, Map<String, Object>> activiy_name_value = new HashMap<String, Map<String, Object>>();

    // 从历史中读取变量
View Full Code Here

    System.out.println("id " + processInstance.getId() + " " + processInstance.getProcessDefinitionId());
   
    TaskService taskService = activitiRule.getTaskService();
    Task task = taskService.createTaskQuery().taskCandidateGroup("role1").singleResult();
    assertEquals("分配给角色", task.getName());
    taskService.complete(task.getId());
   
    // 驳回请求
    task = taskService.createTaskQuery().taskAssignee("user1").singleResult();
    assertEquals("处理后驳回", task.getName());
    Map<String, Object> vairables = new HashMap<String, Object>();
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.