Package org.drools.task.service.responsehandlers

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


        client.addTask( task, null,
                        addTaskResponseHandler );

        long taskId = addTaskResponseHandler.getTaskId();
       
        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
        client.claim( taskId,
                      users.get( "steve" ).getId(),
                      responseHandler );
        responseHandler.waitTillDone( 5000 );

        assertEquals( 2,
                      wiser.getMessages().size() );
       
        assertEquals( "steve@domain.com", wiser.getMessages().get( 0 ).getEnvelopeReceiver() );
View Full Code Here


        client.addTask( task, null,
                        addTaskResponseHandler );

        long taskId = addTaskResponseHandler.getTaskId();

        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
        client.claim( taskId,
                      users.get( "steve" ).getId(),
                      responseHandler );
        responseHandler.waitTillDone( 5000 );

        assertEquals( 1,
                      wiser.getMessages().size() );

        assertEquals( "steve@domain.com", wiser.getMessages().get( 0 ).getEnvelopeReceiver() );
View Full Code Here

        client.addTask( task, null,
                        addTaskResponseHandler );

        long taskId = addTaskResponseHandler.getTaskId();

        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
        client.claim( taskId,
                      users.get( "steve" ).getId(),
                      responseHandler );

        responseHandler.waitTillDone( 5000 );

        assertEquals( 1,
                      wiser.getMessages().size() );
       
        assertEquals( "steve@domain.com", wiser.getMessages().get( 0 ).getEnvelopeReceiver() );
View Full Code Here

        client.addTask( task, null,
                        addTaskResponseHandler );

        long taskId = addTaskResponseHandler.getTaskId();

        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
        client.claim( taskId,
                      users.get( "steve" ).getId(),
                      responseHandler );

        responseHandler.waitTillDone( 5000 );

        assertEquals( 0,
                      wiser.getMessages().size() );       
    }      
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(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

    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

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

    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

    Object data = in.readObject();
    in.close();
    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();
    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());
    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

TOP

Related Classes of org.drools.task.service.responsehandlers.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.