Package org.activiti.engine

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


    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("shopping-only-subprocess", variableMap);
    assertNotNull(processInstance.getId());
    System.out.println("id " + processInstance.getId() + " " + processInstance.getProcessDefinitionId());
   
    TaskService taskService = activitiRule.getTaskService();
    Task task = taskService.createTaskQuery().taskAssignee("henryyan").singleResult();
   
    variableMap = new HashMap<String, Object>();
    variableMap.put("amount", 328d);
    taskService.complete(task.getId(), variableMap);
   
View Full Code Here


   
    variableMap = new HashMap<String, Object>();
    variableMap.put("amount", 328d);
    taskService.complete(task.getId(), variableMap);
   
    task = taskService.createTaskQuery().taskAssignee("henryyan").singleResult();
    assertEquals("银行付款", task.getName());
    Object variable = taskService.getVariable(task.getId(), "amount");
    assertNotNull(variable);
    assertEquals(variable, 328d);
  }
View Full Code Here

    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("DymaticTaskName", variableMap);
    assertNotNull(processInstance.getId());
    System.out.println("id " + processInstance.getId() + " "
        + processInstance.getProcessDefinitionId());
    TaskService taskService = activitiRule.getTaskService();
    Task task = taskService.createTaskQuery().singleResult();
    assertEquals("User TaskActiviti", task.getName());
  }
}
View Full Code Here

        ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("threeTask");
        System.out.println("已启动流程:" + processInstance.getId());

        // 完成第一个任务
        TaskService taskService = activitiRule.getTaskService();
        Task task = taskService.createTaskQuery().singleResult();
        assertEquals("user1", task.getAssignee());
        taskService.complete(task.getId());
        System.out.println("完成任务:usertask1");

        // 查询任务,通过调用
View Full Code Here

        assertEquals("user1", task.getAssignee());
        taskService.complete(task.getId());
        System.out.println("完成任务:usertask1");

        // 查询任务,通过调用
        task = taskService.createTaskQuery().singleResult();
        assertEquals("usertask3", task.getTaskDefinitionKey());

        taskService.complete(task.getId());
        System.out.println("完成任务:usertask3");
View Full Code Here

        taskService.complete(task.getId());
        System.out.println("完成任务:usertask3");

        // 任务达到usertask4
        task = taskService.createTaskQuery().singleResult();
        assertEquals("usertask4", task.getTaskDefinitionKey());

        // 为usertask4设置办理人
        taskService.setAssignee(task.getId(), "user1");
View Full Code Here

        // 为usertask4设置办理人
        taskService.setAssignee(task.getId(), "user1");

        // 任务到达usertask7
        task = taskService.createTaskQuery().singleResult();
        // taskService.claim(task.getId(), "user1");
        assertEquals("目的地", task.getName());

        List<Comment> processInstanceComments = taskService.getProcessInstanceComments(processInstance.getProcessInstanceId());
        assertEquals(4, processInstanceComments.size());
View Full Code Here

    // record events
    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put(TEST_VARIABLE, TEST_VALUE);
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey(USERTASK_PROCESS, BUSINESS_KEY, variables);

    Task task = taskService.createTaskQuery().taskDefinitionKey("userTask").singleResult();
    TimeUnit.MILLISECONDS.sleep(50);
    variables = new HashMap<String, Object>();
    variables.put(TASK_TEST_VARIABLE, TASK_TEST_VALUE);
    taskService.complete(task.getId(), variables);
View Full Code Here

    simRun.init(new NoExecutionVariableScope());

    // original process is finished - there should not be any running process instance/task
    assertEquals(0, runtimeService.createProcessInstanceQuery().processDefinitionKey(USERTASK_PROCESS).count());
    assertEquals(0, taskService.createTaskQuery().taskDefinitionKey("userTask").count());

    simRun.step();

    // replay process was started
    ProcessInstance replayProcessInstance = runtimeService.createProcessInstanceQuery()
View Full Code Here

        .singleResult();
    assertNotNull(replayProcessInstance);
    assertTrue(replayProcessInstance.getId().equals(processInstance.getId()) == false);
    assertEquals(TEST_VALUE, runtimeService.getVariable(replayProcessInstance.getId(), TEST_VARIABLE));
    // there should be one task
    assertEquals(1, taskService.createTaskQuery().taskDefinitionKey("userTask").count());

    simRun.step();

    // userTask was completed - replay process was finished
    assertEquals(0, runtimeService.createProcessInstanceQuery().processDefinitionKey(USERTASK_PROCESS).count());
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.