Package org.drools.task.service.responsehandlers

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


        client.getTask( taskId, getTaskResponseHandler );
        Task task1 = getTaskResponseHandler.getTask();
        assertEquals( Status.Ready , task1.getTaskData().getStatus() );        
       
        EventKey key = new TaskEventKey(TaskClaimedEvent.class, taskId );          
        BlockingEventResponseHandler handler = new BlockingEventResponseHandler();
        client.registerForEvent( key, true, handler );
        Thread.sleep( 3000 );
       
        taskSession.taskOperation( Operation.Claim, taskId, users.get( "darth" ).getId(), null, null );         
        handler.waitTillDone( 5000 );
       
        Payload payload = handler.getPayload();
        TaskUserEvent event = ( TaskUserEvent ) payload.get();
        assertNotNull( event );       
    }
View Full Code Here


        client.addTask( task, null, addTaskResponseHandler );
       
        long taskId = addTaskResponseHandler.getTaskId();
       
        EventKey key = new TaskEventKey(TaskCompletedEvent.class, taskId );          
        BlockingEventResponseHandler handler = new BlockingEventResponseHandler();
        client.registerForEvent( key, true, handler );
       
        BlockingTaskSummaryResponseHandler taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
        client.getTasksAssignedAsPotentialOwner(users.get( "bobba" ).getId(), "en-UK", taskSummaryResponseHandler);
        List<TaskSummary> tasks = taskSummaryResponseHandler.getResults();
        assertEquals(1, tasks.size());
        assertEquals(Status.Reserved, tasks.get(0).getStatus());
       
        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
        client.start( taskId, users.get( "bobba" ).getId(), responseHandler )

        taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
        client.getTasksAssignedAsPotentialOwner(users.get( "bobba" ).getId(), "en-UK", taskSummaryResponseHandler);
        tasks = taskSummaryResponseHandler.getResults();
        assertEquals(1, tasks.size());
        assertEquals(Status.InProgress, tasks.get(0).getStatus());
       
        responseHandler = new BlockingTaskOperationResponseHandler();
        client.complete( taskId, users.get( "bobba" ).getId(), null, responseHandler );
       
        taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
        client.getTasksAssignedAsPotentialOwner(users.get( "bobba" ).getId(), "en-UK", taskSummaryResponseHandler);
        tasks = taskSummaryResponseHandler.getResults();
        assertEquals(0, tasks.size());
       
        Payload payload = handler.getPayload();
        TaskCompletedEvent event = ( TaskCompletedEvent ) payload.get();
        assertNotNull( event );
       
        BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();
        client.getTask( taskId, getTaskResponseHandler );
View Full Code Here

        Task task = ( Task eval( new StringReader( str ), vars );
        client.addTask( task, null, addTaskResponseHandler );
        long taskId = addTaskResponseHandler.getTaskId();
       
        EventKey key = new TaskEventKey(TaskCompletedEvent.class, taskId );          
        BlockingEventResponseHandler handler = new BlockingEventResponseHandler();
        client.registerForEvent( key, true, handler );
       
        BlockingTaskSummaryResponseHandler taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
        client.getTasksAssignedAsPotentialOwner(users.get( "bobba" ).getId(), "en-UK", taskSummaryResponseHandler);
        List<TaskSummary> tasks = taskSummaryResponseHandler.getResults();
        assertEquals(1, tasks.size());
        assertEquals(Status.Reserved, tasks.get(0).getStatus());
       
        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
        client.start( taskId, users.get( "bobba" ).getId(), responseHandler )

        taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
        client.getTasksAssignedAsPotentialOwner(users.get( "bobba" ).getId(), "en-UK", taskSummaryResponseHandler);
        tasks = taskSummaryResponseHandler.getResults();
        assertEquals(1, tasks.size());
        assertEquals(Status.InProgress, tasks.get(0).getStatus());
       
        BlockingAddTaskResponseHandler addTaskResponseHandler2 = new BlockingAddTaskResponseHandler();
        Task task2 = ( Task eval( new StringReader( str ), vars );
        client.addTask( task2, null, addTaskResponseHandler2 );
        long taskId2 = addTaskResponseHandler.getTaskId();
       
        EventKey key2 = new TaskEventKey(TaskCompletedEvent.class, taskId2 );          
        BlockingEventResponseHandler handler2 = new BlockingEventResponseHandler();
        client.registerForEvent( key2, true, handler2 );
       
        taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
        client.getTasksAssignedAsPotentialOwner(users.get( "bobba" ).getId(), "en-UK", taskSummaryResponseHandler);
        tasks = taskSummaryResponseHandler.getResults();
View Full Code Here

        client.getTask( taskId, getTaskResponseHandler );
        Task task1 = getTaskResponseHandler.getTask();
        assertEquals( Status.Ready , task1.getTaskData().getStatus() );        
       
        EventKey key = new TaskEventKey(TaskClaimedEvent.class, taskId );          
        BlockingEventResponseHandler handler = new BlockingEventResponseHandler();
        client.registerForEvent( key, true, handler );
        Thread.sleep( 3000 );
       
        taskSession.taskOperation( Operation.Claim, taskId, users.get( "darth" ).getId(), null, null, null );         
        handler.waitTillDone( 5000 );
       
        Payload payload = handler.getPayload();
        TaskUserEvent event = ( TaskUserEvent ) payload.get();
        assertNotNull( event );       
    }
View Full Code Here

        client.addTask( task, null, addTaskResponseHandler );
       
        long taskId = addTaskResponseHandler.getTaskId();
       
        EventKey key = new TaskEventKey(TaskCompletedEvent.class, taskId );          
        BlockingEventResponseHandler handler = new BlockingEventResponseHandler();
        client.registerForEvent( key, true, handler );
       
        BlockingTaskSummaryResponseHandler taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
        client.getTasksAssignedAsPotentialOwner(users.get( "bobba" ).getId(), "en-UK", taskSummaryResponseHandler);
        List<TaskSummary> tasks = taskSummaryResponseHandler.getResults();
        assertEquals(1, tasks.size());
        assertEquals(Status.Reserved, tasks.get(0).getStatus());
       
        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
        client.start( taskId, users.get( "bobba" ).getId(), responseHandler )

        taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
        client.getTasksAssignedAsPotentialOwner(users.get( "bobba" ).getId(), "en-UK", taskSummaryResponseHandler);
        tasks = taskSummaryResponseHandler.getResults();
        assertEquals(1, tasks.size());
        assertEquals(Status.InProgress, tasks.get(0).getStatus());
       
        responseHandler = new BlockingTaskOperationResponseHandler();
        client.complete( taskId, users.get( "bobba" ).getId(), null, responseHandler );
       
        taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
        client.getTasksAssignedAsPotentialOwner(users.get( "bobba" ).getId(), "en-UK", taskSummaryResponseHandler);
        tasks = taskSummaryResponseHandler.getResults();
        assertEquals(0, tasks.size());
       
        Payload payload = handler.getPayload();
        TaskCompletedEvent event = ( TaskCompletedEvent ) payload.get();
        assertNotNull( event );
       
        BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();
        client.getTask( taskId, getTaskResponseHandler );
View Full Code Here

        Task task = ( Task eval( new StringReader( str ), vars );
        client.addTask( task, null, addTaskResponseHandler );
        long taskId = addTaskResponseHandler.getTaskId();
       
        EventKey key = new TaskEventKey(TaskCompletedEvent.class, taskId );          
        BlockingEventResponseHandler handler = new BlockingEventResponseHandler();
        client.registerForEvent( key, true, handler );
       
        BlockingTaskSummaryResponseHandler taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
        client.getTasksAssignedAsPotentialOwner(users.get( "bobba" ).getId(), "en-UK", taskSummaryResponseHandler);
        List<TaskSummary> tasks = taskSummaryResponseHandler.getResults();
        assertEquals(1, tasks.size());
        assertEquals(Status.Reserved, tasks.get(0).getStatus());
       
        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
        client.start( taskId, users.get( "bobba" ).getId(), responseHandler )

        taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
        client.getTasksAssignedAsPotentialOwner(users.get( "bobba" ).getId(), "en-UK", taskSummaryResponseHandler);
        tasks = taskSummaryResponseHandler.getResults();
        assertEquals(1, tasks.size());
        assertEquals(Status.InProgress, tasks.get(0).getStatus());
       
        BlockingAddTaskResponseHandler addTaskResponseHandler2 = new BlockingAddTaskResponseHandler();
        Task task2 = ( Task eval( new StringReader( str ), vars );
        client.addTask( task2, null, addTaskResponseHandler2 );
        long taskId2 = addTaskResponseHandler.getTaskId();
       
        EventKey key2 = new TaskEventKey(TaskCompletedEvent.class, taskId2 );          
        BlockingEventResponseHandler handler2 = new BlockingEventResponseHandler();
        client.registerForEvent( key2, true, handler2 );
       
        taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
        client.getTasksAssignedAsPotentialOwner(users.get( "bobba" ).getId(), "en-UK", taskSummaryResponseHandler);
        tasks = taskSummaryResponseHandler.getResults();
View Full Code Here

        client.getTask( taskId, getTaskResponseHandler );
        Task task1 = getTaskResponseHandler.getTask();
        assertEquals( Status.Ready , task1.getTaskData().getStatus() );        
       
        EventKey key = new TaskEventKey(TaskClaimedEvent.class, taskId );          
        BlockingEventResponseHandler handler = new BlockingEventResponseHandler();
        client.registerForEvent( key, true, handler );
        Thread.sleep( 3000 );
       
        taskSession.taskOperation( Operation.Claim, taskId, users.get( "darth" ).getId(), null, null );         
        handler.waitTillDone( 5000 );
       
        Payload payload = handler.getPayload();
        TaskUserEvent event = ( TaskUserEvent ) payload.get();
        assertNotNull( event );       
    }
View Full Code Here

        client.getTask( taskId, getTaskResponseHandler );
        Task task1 = getTaskResponseHandler.getTask();
        assertEquals( Status.Ready , task1.getTaskData().getStatus() );        
       
        EventKey key = new TaskEventKey(TaskClaimedEvent.class, taskId );          
        BlockingEventResponseHandler handler = new BlockingEventResponseHandler();
        client.registerForEvent( key, true, handler );
        Thread.sleep( 3000 );
       
        taskSession.taskOperation( Operation.Claim, taskId, users.get( "darth" ).getId(), null, null, null );         
        handler.waitTillDone( 5000 );
       
        Payload payload = handler.getPayload();
        TaskUserEvent event = ( TaskUserEvent ) payload.get();
        assertNotNull( event );       
    }
View Full Code Here

        client.addTask( task, null, addTaskResponseHandler );
       
        long taskId = addTaskResponseHandler.getTaskId();
       
        EventKey key = new TaskEventKey(TaskCompletedEvent.class, taskId );          
        BlockingEventResponseHandler handler = new BlockingEventResponseHandler();
        client.registerForEvent( key, true, handler );
       
        BlockingTaskSummaryResponseHandler taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
        client.getTasksAssignedAsPotentialOwner(users.get( "bobba" ).getId(), "en-UK", taskSummaryResponseHandler);
        List<TaskSummary> tasks = taskSummaryResponseHandler.getResults();
        assertEquals(1, tasks.size());
        assertEquals(Status.Reserved, tasks.get(0).getStatus());
       
        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
        client.start( taskId, users.get( "bobba" ).getId(), responseHandler )

        taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
        client.getTasksAssignedAsPotentialOwner(users.get( "bobba" ).getId(), "en-UK", taskSummaryResponseHandler);
        tasks = taskSummaryResponseHandler.getResults();
        assertEquals(1, tasks.size());
        assertEquals(Status.InProgress, tasks.get(0).getStatus());
       
        responseHandler = new BlockingTaskOperationResponseHandler();
        client.complete( taskId, users.get( "bobba" ).getId(), null, responseHandler );
       
        taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
        client.getTasksAssignedAsPotentialOwner(users.get( "bobba" ).getId(), "en-UK", taskSummaryResponseHandler);
        tasks = taskSummaryResponseHandler.getResults();
        assertEquals(0, tasks.size());
       
        Payload payload = handler.getPayload();
        TaskCompletedEvent event = ( TaskCompletedEvent ) payload.get();
        assertNotNull( event );
       
        BlockingGetTaskResponseHandler getTaskResponseHandler = new BlockingGetTaskResponseHandler();
        client.getTask( taskId, getTaskResponseHandler );
View Full Code Here

        Task task = ( Task eval( new StringReader( str ), vars );
        client.addTask( task, null, addTaskResponseHandler );
        long taskId = addTaskResponseHandler.getTaskId();
       
        EventKey key = new TaskEventKey(TaskCompletedEvent.class, taskId );          
        BlockingEventResponseHandler handler = new BlockingEventResponseHandler();
        client.registerForEvent( key, true, handler );
       
        BlockingTaskSummaryResponseHandler taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
        client.getTasksAssignedAsPotentialOwner(users.get( "bobba" ).getId(), "en-UK", taskSummaryResponseHandler);
        List<TaskSummary> tasks = taskSummaryResponseHandler.getResults();
        assertEquals(1, tasks.size());
        assertEquals(Status.Reserved, tasks.get(0).getStatus());
       
        BlockingTaskOperationResponseHandler responseHandler = new BlockingTaskOperationResponseHandler();
        client.start( taskId, users.get( "bobba" ).getId(), responseHandler )

        taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
        client.getTasksAssignedAsPotentialOwner(users.get( "bobba" ).getId(), "en-UK", taskSummaryResponseHandler);
        tasks = taskSummaryResponseHandler.getResults();
        assertEquals(1, tasks.size());
        assertEquals(Status.InProgress, tasks.get(0).getStatus());
       
        BlockingAddTaskResponseHandler addTaskResponseHandler2 = new BlockingAddTaskResponseHandler();
        Task task2 = ( Task eval( new StringReader( str ), vars );
        client.addTask( task2, null, addTaskResponseHandler2 );
        long taskId2 = addTaskResponseHandler.getTaskId();
       
        EventKey key2 = new TaskEventKey(TaskCompletedEvent.class, taskId2 );          
        BlockingEventResponseHandler handler2 = new BlockingEventResponseHandler();
        client.registerForEvent( key2, true, handler2 );
       
        taskSummaryResponseHandler = new BlockingTaskSummaryResponseHandler();
        client.getTasksAssignedAsPotentialOwner(users.get( "bobba" ).getId(), "en-UK", taskSummaryResponseHandler);
        tasks = taskSummaryResponseHandler.getResults();
View Full Code Here

TOP

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

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.