Package org.drools.task.service

Examples of org.drools.task.service.BlockingTaskOperationResponseHandler


    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();
    client.start(task.getId(), "Darth Vader", operationResponseHandler);
    operationResponseHandler.waitTillDone(5000);
    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(5000);
    System.out.println("Completed task " + task.getId());
   
    assertTrue(manager.isCompleted());
  }
View Full Code Here


    assertEquals(10, task.getPriority());
    assertEquals("Comment", task.getDescription());
    assertEquals(Status.Ready, task.getStatus());
   
    System.out.println("Claiming task " + task.getId());
    BlockingTaskOperationResponseHandler operationResponseHandler = new BlockingTaskOperationResponseHandler();
    client.claim(task.getId(), "Darth Vader", operationResponseHandler);
    operationResponseHandler.waitTillDone(5000);
    System.out.println("Claimed task " + task.getId());
   
    System.out.println("Starting task " + task.getId());
    operationResponseHandler = new BlockingTaskOperationResponseHandler();
    client.start(task.getId(), "Darth Vader", operationResponseHandler);
    operationResponseHandler.waitTillDone(5000);
    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(5000);
    System.out.println("Completed task " + task.getId());
   
    assertTrue(manager.isCompleted());
  }
View Full Code Here

    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();
    client.start(task.getId(), "Darth Vader", operationResponseHandler);
    operationResponseHandler.waitTillDone(5000);
    System.out.println("Started task " + task.getId());
   
    System.out.println("Failing task " + task.getId());
    operationResponseHandler = new BlockingTaskOperationResponseHandler();
    client.fail(task.getId(), "Darth Vader", null, operationResponseHandler);
    operationResponseHandler.waitTillDone(5000);
    System.out.println("Failed task " + task.getId());
   
    assertTrue(manager.isAborted());
  }
View Full Code Here

    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();
    client.skip(task.getId(), "Darth Vader", operationResponseHandler);
    operationResponseHandler.waitTillDone(5000);
    System.out.println("Skipped task " + task.getId());
   
    assertTrue(manager.isAborted());
  }
View Full Code Here

    Object data = in.readObject();
    in.close();
    assertEquals("This is the content", data);
   
    System.out.println("Starting task " + task.getId());
    BlockingTaskOperationResponseHandler operationResponseHandler = new BlockingTaskOperationResponseHandler();
    client.start(task.getId(), "Darth Vader", operationResponseHandler);
    operationResponseHandler.waitTillDone(5000);
    System.out.println("Started task " + task.getId());
   
    System.out.println("Completing task " + task.getId());
    operationResponseHandler = new BlockingTaskOperationResponseHandler();
    ContentData result = new ContentData();
    result.setAccessType(AccessType.Inline);
    result.setType("java.lang.String");
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    ObjectOutputStream out = new ObjectOutputStream(bos);
    out.writeObject("This is the result");
    out.close();
    result.setContent(bos.toByteArray());
    client.complete(task.getId(), "Darth Vader", result, operationResponseHandler);
    operationResponseHandler.waitTillDone(5000);
    System.out.println("Completed task " + task.getId());
   
    assertTrue(manager.isCompleted());
    Map<String, Object> results = manager.getResults();
    assertNotNull(results);
View Full Code Here

TOP

Related Classes of org.drools.task.service.BlockingTaskOperationResponseHandler

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.