Package org.jbpm.task.query

Examples of org.jbpm.task.query.TaskSummary


    BlockingTaskSummaryResponseHandler responseHandler = new BlockingTaskSummaryResponseHandler();
    getClient().getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK", responseHandler);
    List<TaskSummary> tasks = responseHandler.getResults();
    assertEquals(1, tasks.size());
    TaskSummary taskSummary = tasks.get(0);
    assertEquals("TaskName", taskSummary.getName());
    assertEquals(10, taskSummary.getPriority());
    assertEquals("Comment", taskSummary.getDescription());
    assertEquals(Status.Reserved, taskSummary.getStatus());
    assertEquals("Darth Vader", taskSummary.getActualOwner().getId());

    BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();
    getClient().getTask(taskSummary.getId(), getTaskResponseHandler);
    Task task = getTaskResponseHandler.getTask();
    assertEquals(AccessType.Inline, task.getTaskData().getDocumentAccessType());
    long contentId = task.getTaskData().getDocumentContentId();
    assertTrue(contentId != -1);
    BlockingGetContentResponseHandler getContentResponseHandler = new BlockingGetContentResponseHandler();
View Full Code Here


    BlockingTaskSummaryResponseHandler responseHandler = new BlockingTaskSummaryResponseHandler();
    getClient().getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK", responseHandler);
    List<TaskSummary> tasks = responseHandler.getResults();
    assertEquals(1, tasks.size());
    TaskSummary taskSummary = tasks.get(0);
    assertEquals("TaskName", taskSummary.getName());
    assertEquals(10, taskSummary.getPriority());
    assertEquals("Comment", taskSummary.getDescription());
    assertEquals(Status.Reserved, taskSummary.getStatus());
    assertEquals("Darth Vader", taskSummary.getActualOwner().getId());
               
               

    BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();
    getClient().getTask(taskSummary.getId(), getTaskResponseHandler);
    Task task = getTaskResponseHandler.getTask();
    assertEquals(AccessType.Inline, task.getTaskData().getDocumentAccessType());
    long contentId = task.getTaskData().getDocumentContentId();
    assertTrue(contentId != -1);
    BlockingGetContentResponseHandler getContentResponseHandler = new BlockingGetContentResponseHandler();
View Full Code Here

    //Test if the task is succesfully created
    BlockingTaskSummaryResponseHandler responseHandler = new BlockingTaskSummaryResponseHandler();
    getClient().getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK", responseHandler);
    List<TaskSummary> tasks = responseHandler.getResults();
    assertEquals(1, tasks.size());
    TaskSummary task = tasks.get(0);
    assertEquals("TaskNameParent", task.getName());
    assertEquals(10, task.getPriority());
    assertEquals("CommentParent", task.getDescription());
    assertEquals(Status.Reserved, task.getStatus());
    assertEquals("Darth Vader", task.getActualOwner().getId());

    //Create the child task
    workItem = new WorkItemImpl();
    workItem.setName("Human Task");
    workItem.setParameter("TaskName", "TaskNameChild1");
    workItem.setParameter("Comment", "CommentChild1");
    workItem.setParameter("Priority", "10");
    workItem.setParameter("ActorId", "Darth Vader");
    workItem.setParameter("ParentId", task.getId());
    getHandler().executeWorkItem(workItem, manager);

    Thread.sleep(500);

    //Create the child task2
    workItem = new WorkItemImpl();
    workItem.setName("Human Task2");
    workItem.setParameter("TaskName", "TaskNameChild2");
    workItem.setParameter("Comment", "CommentChild2");
    workItem.setParameter("Priority", "10");
    workItem.setParameter("ActorId", "Darth Vader");
    workItem.setParameter("ParentId", task.getId());
    getHandler().executeWorkItem(workItem, manager);

    Thread.sleep(500);

    //Start the parent task
    System.out.println("Starting task " + task.getId());
    BlockingTaskOperationResponseHandler operationResponseHandler = new BlockingTaskOperationResponseHandler();
    getClient().start(task.getId(), "Darth Vader", operationResponseHandler);
    operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
    System.out.println("Started task " + task.getId());

    //Check if the parent task is InProgress
    BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();
    getClient().getTask(task.getId(), getTaskResponseHandler);
    Task parentTask = getTaskResponseHandler.getTask();
    assertEquals(Status.InProgress, parentTask.getTaskData().getStatus());
    assertEquals(users.get("darth"), parentTask.getTaskData().getActualOwner());

    //Get all the subtask created for the parent task based on the potential owner
    responseHandler = new BlockingTaskSummaryResponseHandler();
    getClient().getSubTasksAssignedAsPotentialOwner(parentTask.getId(), "Darth Vader", "en-UK", responseHandler);
    List<TaskSummary> subTasks = responseHandler.getResults();
    assertEquals(2, subTasks.size());
    TaskSummary subTaskSummary1 = subTasks.get(0);
    TaskSummary subTaskSummary2 = subTasks.get(1);
    assertNotNull(subTaskSummary1);
    assertNotNull(subTaskSummary2);

    //Starting the sub task 1
    System.out.println("Starting sub task " + subTaskSummary1.getId());
    operationResponseHandler = new BlockingTaskOperationResponseHandler();
    getClient().start(subTaskSummary1.getId(), "Darth Vader", operationResponseHandler);
    operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
    System.out.println("Started sub task " + subTaskSummary1.getId());

    //Starting the sub task 2
    System.out.println("Starting sub task " + subTaskSummary2.getId());
    operationResponseHandler = new BlockingTaskOperationResponseHandler();
    getClient().start(subTaskSummary2.getId(), "Darth Vader", operationResponseHandler);
    operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
    System.out.println("Started sub task " + subTaskSummary2.getId());

    //Check if the child task 1 is InProgress
    getTaskResponseHandler = new BlockingGetTaskResponseHandler();
    getClient().getTask(subTaskSummary1.getId(), getTaskResponseHandler);
    Task subTask1 = getTaskResponseHandler.getTask();
    assertEquals(Status.InProgress, subTask1.getTaskData().getStatus());
    assertEquals(users.get("darth"), subTask1.getTaskData().getActualOwner());

    //Check if the child task 2 is InProgress
    getTaskResponseHandler = new BlockingGetTaskResponseHandler();
    getClient().getTask(subTaskSummary2.getId(), getTaskResponseHandler);
    Task subTask2 = getTaskResponseHandler.getTask();
    assertEquals(Status.InProgress, subTask2.getTaskData().getStatus());
    assertEquals(users.get("darth"), subTask2.getTaskData().getActualOwner());

    // Complete the child task 1
View Full Code Here

    //Test if the task is succesfully created
    BlockingTaskSummaryResponseHandler responseHandler = new BlockingTaskSummaryResponseHandler();
    getClient().getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK", responseHandler);
    List<TaskSummary> tasks = responseHandler.getResults();
    assertEquals(1, tasks.size());
    TaskSummary task = tasks.get(0);
    assertEquals("TaskNameParent", task.getName());
    assertEquals(10, task.getPriority());
    assertEquals("CommentParent", task.getDescription());
    assertEquals(Status.Reserved, task.getStatus());
    assertEquals("Darth Vader", task.getActualOwner().getId());

    //Create the child task
    workItem = new WorkItemImpl();
    workItem.setName("Human Task");
    workItem.setParameter("TaskName", "TaskNameChild1");
    workItem.setParameter("Comment", "CommentChild1");
    workItem.setParameter("Priority", "10");
    workItem.setParameter("ActorId", "Darth Vader");
    workItem.setParameter("ParentId", task.getId());
    getHandler().executeWorkItem(workItem, manager);

    Thread.sleep(500);

    //Create the child task2
    workItem = new WorkItemImpl();
    workItem.setName("Human Task2");
    workItem.setParameter("TaskName", "TaskNameChild2");
    workItem.setParameter("Comment", "CommentChild2");
    workItem.setParameter("Priority", "10");
    workItem.setParameter("ActorId", "Darth Vader");
    workItem.setParameter("ParentId", task.getId());
    getHandler().executeWorkItem(workItem, manager);

    Thread.sleep(500);

    //Start the parent task
    System.out.println("Starting task " + task.getId());
    BlockingTaskOperationResponseHandler operationResponseHandler = new BlockingTaskOperationResponseHandler();
    getClient().start(task.getId(), "Darth Vader", operationResponseHandler);
    operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
    System.out.println("Started task " + task.getId());

    //Check if the parent task is InProgress
    BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();
    getClient().getTask(task.getId(), getTaskResponseHandler);
    Task parentTask = getTaskResponseHandler.getTask();
    assertEquals(Status.InProgress, parentTask.getTaskData().getStatus());
    assertEquals(users.get("darth"), parentTask.getTaskData().getActualOwner());

    //Get all the subtask created for the parent task based on the potential owner
    responseHandler = new BlockingTaskSummaryResponseHandler();
    getClient().getSubTasksAssignedAsPotentialOwner(parentTask.getId(), "Darth Vader", "en-UK", responseHandler);
    List<TaskSummary> subTasks = responseHandler.getResults();
    assertEquals(2, subTasks.size());
    TaskSummary subTaskSummary1 = subTasks.get(0);
    TaskSummary subTaskSummary2 = subTasks.get(1);
    assertNotNull(subTaskSummary1);
    assertNotNull(subTaskSummary2);

    //Starting the sub task 1
    System.out.println("Starting sub task " + subTaskSummary1.getId());
    operationResponseHandler = new BlockingTaskOperationResponseHandler();
    getClient().start(subTaskSummary1.getId(), "Darth Vader", operationResponseHandler);
    operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
    System.out.println("Started sub task " + subTaskSummary1.getId());

    //Starting the sub task 2
    System.out.println("Starting sub task " + subTaskSummary2.getId());
    operationResponseHandler = new BlockingTaskOperationResponseHandler();
    getClient().start(subTaskSummary2.getId(), "Darth Vader", operationResponseHandler);
    operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
    System.out.println("Started sub task " + subTaskSummary2.getId());

    //Check if the child task 1 is InProgress
    getTaskResponseHandler = new BlockingGetTaskResponseHandler();
    getClient().getTask(subTaskSummary1.getId(), getTaskResponseHandler);
    Task subTask1 = getTaskResponseHandler.getTask();
    assertEquals(Status.InProgress, subTask1.getTaskData().getStatus());
    assertEquals(users.get("darth"), subTask1.getTaskData().getActualOwner());

    //Check if the child task 2 is InProgress
    getTaskResponseHandler = new BlockingGetTaskResponseHandler();
    getClient().getTask(subTaskSummary2.getId(), getTaskResponseHandler);
    Task subTask2 = getTaskResponseHandler.getTask();
    assertEquals(Status.InProgress, subTask2.getTaskData().getStatus());
    assertEquals(users.get("darth"), subTask2.getTaskData().getActualOwner());

    // Complete the parent task
    System.out.println("Completing parent task " + parentTask.getId());
    operationResponseHandler = new BlockingTaskOperationResponseHandler();
    getClient().skip(parentTask.getId(), "Darth Vader", operationResponseHandler);
    operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
    System.out.println("Completed parent task " + parentTask.getId());

    //Check if the child task 1 is Completed
    getTaskResponseHandler = new BlockingGetTaskResponseHandler();
    getClient().getTask(subTaskSummary1.getId(), getTaskResponseHandler);
    subTask1 = getTaskResponseHandler.getTask();
    assertEquals(Status.Completed, subTask1.getTaskData().getStatus());
    assertEquals(users.get("darth"), subTask1.getTaskData().getActualOwner());

    //Check if the child task 2 is Completed
    getTaskResponseHandler = new BlockingGetTaskResponseHandler();
    getClient().getTask(subTaskSummary2.getId(), getTaskResponseHandler);
    subTask2 = getTaskResponseHandler.getTask();
    assertEquals(Status.Completed, subTask2.getTaskData().getStatus());
    assertEquals(users.get("darth"), subTask2.getTaskData().getActualOwner());

    assertTrue(manager.waitTillCompleted(MANAGER_COMPLETION_WAIT_TIME));
View Full Code Here

        BlockingTaskSummaryResponseHandler responseHandler = new BlockingTaskSummaryResponseHandler();
        client.getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK", responseHandler);
        List<TaskSummary> tasks = responseHandler.getResults();
        assertEquals(1, tasks.size());
        TaskSummary task = tasks.get(0);
        assertEquals("TaskName", task.getName());
        assertEquals(10, task.getPriority());
        assertEquals("Comment", task.getDescription());
        assertEquals(Status.Reserved, task.getStatus());
        assertEquals("Darth Vader", task.getActualOwner().getId());
        assertEquals(10, task.getProcessInstanceId());

        System.out.println("Starting task " + task.getId());
        BlockingTaskOperationResponseHandler operationResponseHandler = new BlockingTaskOperationResponseHandler();
        client.start(task.getId(), "Darth Vader", operationResponseHandler);
        operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
        System.out.println("Started task " + task.getId());

        System.out.println("Completing task " + task.getId());
        operationResponseHandler = new BlockingTaskOperationResponseHandler();
        client.complete(task.getId(), "Darth Vader", null, operationResponseHandler);
        operationResponseHandler.waitTillDone(15000);
        System.out.println("Completed task " + task.getId());

        assertTrue(manager.waitTillCompleted(MANAGER_COMPLETION_WAIT_TIME));
  }
View Full Code Here

    BlockingTaskSummaryResponseHandler responseHandler = new BlockingTaskSummaryResponseHandler();
    getClient().getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK", responseHandler);
    List<TaskSummary> tasks = responseHandler.getResults();
    assertEquals(1, tasks.size());
    TaskSummary task = tasks.get(0);
    assertEquals("TaskName", task.getName());
    assertEquals(10, task.getPriority());
    assertEquals("Comment", task.getDescription());
    assertEquals(Status.Ready, task.getStatus());

    System.out.println("Claiming task " + task.getId());
    BlockingTaskOperationResponseHandler operationResponseHandler = new BlockingTaskOperationResponseHandler();
    getClient().claim(task.getId(), "Darth Vader", operationResponseHandler);
    operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
    System.out.println("Claimed task " + task.getId());

    System.out.println("Starting task " + task.getId());
    operationResponseHandler = new BlockingTaskOperationResponseHandler();
    getClient().start(task.getId(), "Darth Vader", operationResponseHandler);
    operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
    System.out.println("Started task " + task.getId());

    System.out.println("Completing task " + task.getId());
    operationResponseHandler = new BlockingTaskOperationResponseHandler();
    getClient().complete(task.getId(), "Darth Vader", null, operationResponseHandler);
    operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
    System.out.println("Completed task " + task.getId());

    assertTrue(manager.waitTillCompleted(MANAGER_COMPLETION_WAIT_TIME));
  }
View Full Code Here

    List<String> groupIds = new ArrayList<String>();
    groupIds.add("Crusaders");
    getClient().getTasksAssignedAsPotentialOwner(null, groupIds, "en-UK", responseHandler);
    List<TaskSummary> tasks = responseHandler.getResults();
    assertEquals(1, tasks.size());
    TaskSummary taskSummary = tasks.get(0);
    assertEquals("TaskName", taskSummary.getName());
    assertEquals(10, taskSummary.getPriority());
    assertEquals("Comment", taskSummary.getDescription());
    assertEquals(Status.Ready, taskSummary.getStatus());

    System.out.println("Claiming task " + taskSummary.getId());
    BlockingTaskOperationResponseHandler operationResponseHandler = new BlockingTaskOperationResponseHandler();
    getClient().claim(taskSummary.getId(), "Darth Vader", operationResponseHandler);
    PermissionDeniedException denied = null;
    try {
      operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
    } catch (PermissionDeniedException e) {
      denied = e;
    }

    assertNotNull("Should get permissed denied exception", denied);
    System.out.println("Claimed task " + taskSummary.getId());

    //Check if the parent task is InProgress
    BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();
    getClient().getTask(taskSummary.getId(), getTaskResponseHandler);
    Task task = getTaskResponseHandler.getTask();
    assertEquals(Status.Ready, task.getTaskData().getStatus());
  }
View Full Code Here

    BlockingTaskSummaryResponseHandler responseHandler = new BlockingTaskSummaryResponseHandler();
    getClient().getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK", responseHandler);
    List<TaskSummary> tasks = responseHandler.getResults();
    assertEquals(1, tasks.size());
    TaskSummary task = tasks.get(0);
    assertEquals("TaskName", task.getName());
    assertEquals(10, task.getPriority());
    assertEquals("Comment", task.getDescription());
    assertEquals(Status.Reserved, task.getStatus());
    assertEquals("Darth Vader", task.getActualOwner().getId());

    System.out.println("Starting task " + task.getId());
    BlockingTaskOperationResponseHandler operationResponseHandler = new BlockingTaskOperationResponseHandler();
    getClient().start(task.getId(), "Darth Vader", operationResponseHandler);
    operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
    System.out.println("Started task " + task.getId());

    System.out.println("Failing task " + task.getId());
    operationResponseHandler = new BlockingTaskOperationResponseHandler();
    getClient().fail(task.getId(), "Darth Vader", null, operationResponseHandler);
    operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
    System.out.println("Failed task " + task.getId());

    assertTrue(manager.waitTillAborted(MANAGER_ABORT_WAIT_TIME));
  }
View Full Code Here

    BlockingTaskSummaryResponseHandler responseHandler = new BlockingTaskSummaryResponseHandler();
    getClient().getTasksAssignedAsPotentialOwner("Darth Vader", "en-UK", responseHandler);
    List<TaskSummary> tasks = responseHandler.getResults();
    assertEquals(1, tasks.size());
    TaskSummary task = tasks.get(0);
    assertEquals("TaskName", task.getName());
    assertEquals(10, task.getPriority());
    assertEquals("Comment", task.getDescription());
    assertEquals(Status.Reserved, task.getStatus());
    assertEquals("Darth Vader", task.getActualOwner().getId());

    System.out.println("Skipping task " + task.getId());
    BlockingTaskOperationResponseHandler operationResponseHandler = new BlockingTaskOperationResponseHandler();
    getClient().skip(task.getId(), "Darth Vader", operationResponseHandler);
    operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
    System.out.println("Skipped task " + task.getId());

    assertTrue(manager.waitTillAborted(MANAGER_ABORT_WAIT_TIME));
  }
View Full Code Here

        client.getTasksAssignedAsPotentialOwner("garage_emergency_service", "en-UK", handler);
        List<TaskSummary> tasks = handler.getResults();

        Assert.assertNotNull(tasks);
        Assert.assertEquals(1, tasks.size());
        TaskSummary taskSummary = tasks.get(0); // getting the first task
        Assert.assertEquals(" Select Vehicle For " + emergency.getId() + " ", taskSummary.getName());

        //Garage team starts working on the task
        BlockingTaskOperationResponseHandler startTaskOperationHandler = new BlockingTaskOperationResponseHandler();
        client.start(tasks.get(0).getId(), "garage_emergency_service", startTaskOperationHandler);
View Full Code Here

TOP

Related Classes of org.jbpm.task.query.TaskSummary

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.