Package org.drools.task.service.responsehandlers

Examples of org.drools.task.service.responsehandlers.BlockingGetTaskResponseHandler


        // Go straight from Ready to Inprogress
        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
        client.start( taskId, users.get( "darth" ).getId(), responseHandler );
        responseHandler.waitTillDone(DEFAULT_WAIT_TIME);
       
        BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler()
        client.getTask( taskId, getTaskResponseHandler );
        Task task1 = getTaskResponseHandler.getTask();
        assertEqualsStatus.InProgress, task1.getTaskData().getStatus() );
        assertEquals( users.get( "darth" ), task1.getTaskData().getActualOwner() )
       
        FaultData data = new FaultData();
        data.setAccessType(AccessType.Inline);
        data.setType("type");
        data.setFaultName("faultName");
        data.setContent("content".getBytes());
        responseHandler = new BlockingTaskOperationResponseHandler();
        client.fail( taskId, users.get( "darth" ).getId(), data, responseHandler );
        responseHandler.waitTillDone(DEFAULT_WAIT_TIME);
       
        getTaskResponseHandler = new BlockingGetTaskResponseHandler()
        client.getTask( taskId, getTaskResponseHandler );
        Task task2 = getTaskResponseHandler.getTask();
        assertEquals( Status.Failed, task2.getTaskData().getStatus() );
        assertEquals( AccessType.Inline, task2.getTaskData().getFaultAccessType() );
        assertEquals( "type", task2.getTaskData().getFaultType() );
        assertEquals( "faultName", task2.getTaskData().getFaultName() );
        long contentId = task2.getTaskData().getFaultContentId();
View Full Code Here


        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();
        client.getTask(taskSummary.getId(), getTaskResponseHandler);
        Task task = getTaskResponseHandler.getTask();
        assertEquals(Status.Ready, task.getTaskData().getStatus());
    }
View Full Code Here

        assertEquals(10, taskSummary.getPriority());
        assertEquals("Comment", taskSummary.getDescription());
        assertEquals(Status.Reserved, taskSummary.getStatus());
        assertEquals("Darth Vader", taskSummary.getActualOwner().getId());

        BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();
        client.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();
        client.getContent(contentId, getContentResponseHandler);
View Full Code Here

        client.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();
        client.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();
        client.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();
        client.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();
        client.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();
        client.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();
        client.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
        System.out.println("Completing sub task " + subTask1.getId());
        operationResponseHandler = new BlockingTaskOperationResponseHandler();
        client.complete(subTask1.getId(), "Darth Vader", null, operationResponseHandler);
        operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
        System.out.println("Completed sub task " + subTask1.getId());

        // Complete the child task 2
        System.out.println("Completing sub task " + subTask2.getId());
        operationResponseHandler = new BlockingTaskOperationResponseHandler();
        client.complete(subTask2.getId(), "Darth Vader", null, operationResponseHandler);
        operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
        System.out.println("Completed sub task " + subTask2.getId());

        //Check if the child task 1 is Completed

        getTaskResponseHandler = new BlockingGetTaskResponseHandler();
        client.getTask(subTask1.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();
        client.getTask(subTask2.getId(), getTaskResponseHandler);
        subTask2 = getTaskResponseHandler.getTask();
        assertEquals(Status.Completed, subTask2.getTaskData().getStatus());
        assertEquals(users.get("darth"), subTask2.getTaskData().getActualOwner());

        // Check is the parent task is Complete
        getTaskResponseHandler = new BlockingGetTaskResponseHandler();
        client.getTask(parentTask.getId(), getTaskResponseHandler);
        parentTask = getTaskResponseHandler.getTask();
        assertEquals(Status.Completed, parentTask.getTaskData().getStatus());
        assertEquals(users.get("darth"), parentTask.getTaskData().getActualOwner());

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

        client.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();
        client.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();
        client.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();
        client.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();
        client.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();
        client.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();
        client.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();
        client.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();
        client.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();
        client.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

    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
    System.out.println("Completing sub task " + subTask1.getId());
    operationResponseHandler = new BlockingTaskOperationResponseHandler();
    getClient().complete(subTask1.getId(), "Darth Vader", null, operationResponseHandler);
    operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
    System.out.println("Completed sub task " + subTask1.getId());

    // Complete the child task 2
    System.out.println("Completing sub task " + subTask2.getId());
    operationResponseHandler = new BlockingTaskOperationResponseHandler();
    getClient().complete(subTask2.getId(), "Darth Vader", null, operationResponseHandler);
    operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
    System.out.println("Completed sub task " + subTask2.getId());

    //Check if the child task 1 is Completed

    getTaskResponseHandler = new BlockingGetTaskResponseHandler();
    getClient().getTask(subTask1.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(subTask2.getId(), getTaskResponseHandler);
    subTask2 = getTaskResponseHandler.getTask();
    assertEquals(Status.Completed, subTask2.getTaskData().getStatus());
    assertEquals(users.get("darth"), subTask2.getTaskData().getActualOwner());

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

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

    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

    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

    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();
    getClient().getContent(contentId, getContentResponseHandler);
View Full Code Here

        client.addTask( task, null, addTaskResponseHandler );
        long taskId = addTaskResponseHandler.getTaskId();   
       
        // Shouldn't have re-assigned yet
        Thread.sleep( 1000 );
        BlockingGetTaskResponseHandler getTaskHandler = new BlockingGetTaskResponseHandler();
        client.getTask( taskId, getTaskHandler );
        task = getTaskHandler.getTask();
        List<OrganizationalEntity> potentialOwners = task.getPeopleAssignments().getPotentialOwners();
        List<String> ids = new ArrayList<String>(potentialOwners.size());
        for ( OrganizationalEntity entity : potentialOwners ) {
            ids.add( entity.getId() );
        }
        assertTrue( ids.contains( users.get( "tony" ).getId() ));
        assertTrue( ids.contains( users.get( "luke" ).getId() ));       
       
        // should have re-assigned by now
        long time = 0;
        while ( getWiser().getMessages().size() != 2 && time < 15000 ) {
            Thread.sleep( 500 );
            time += 500;
        }
       
        getTaskHandler = new BlockingGetTaskResponseHandler();
        client.getTask( taskId, getTaskHandler );
        task = getTaskHandler.getTask();
        assertEquals( Status.Ready, task.getTaskData().getStatus()  );
        potentialOwners = task.getPeopleAssignments().getPotentialOwners();
        System.out.println( potentialOwners );
        ids = new ArrayList<String>(potentialOwners.size());
        for ( OrganizationalEntity entity : potentialOwners ) {
View Full Code Here

TOP

Related Classes of org.drools.task.service.responsehandlers.BlockingGetTaskResponseHandler

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.