Package org.drools.task.service.responsehandlers

Examples of org.drools.task.service.responsehandlers.BlockingTaskOperationResponseHandler.waitTillDone()


    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);
View Full Code Here


    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);
View Full Code Here

    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

    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

    assertEquals("This is the content", data);

    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("Completing task " + task.getId());
    operationResponseHandler = new BlockingTaskOperationResponseHandler();
    ContentData result = new ContentData();
View Full Code Here

    ObjectOutputStream out = new ObjectOutputStream(bos);
    out.writeObject("This is the result");
    out.close();
    result.setContent(bos.toByteArray());
    getClient().complete(task.getId(), "Darth Vader", result, operationResponseHandler);
    operationResponseHandler.waitTillDone(DEFAULT_WAIT_TIME);
    System.out.println("Completed task " + task.getId());

    assertTrue(manager.waitTillCompleted(MANAGER_COMPLETION_WAIT_TIME));
    Map<String, Object> results = manager.getResults();
    assertNotNull(results);
View Full Code Here

    //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);
View Full Code Here

    //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();
View Full Code Here

    //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);
View Full Code Here

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