Search in sources :

Example 1 with FirstErrorWorkItemHandler

use of org.jbpm.test.wih.FirstErrorWorkItemHandler in project jbpm by kiegroup.

the class AsyncEndSignalTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    super.setUp();
    executorService = ExecutorServiceFactory.newExecutorService(getEmf());
    executorService.setInterval(1);
    executorService.init();
    addEnvironmentEntry("ExecutorService", executorService);
    addWorkItemHandler("SyncError", new FirstErrorWorkItemHandler());
    addProcessEventListener(new DefaultProcessEventListener() {

        @Override
        public void afterProcessCompleted(ProcessCompletedEvent event) {
            synchronized (LOCK) {
                LOCK.notifyAll();
            }
        }
    });
}
Also used : FirstErrorWorkItemHandler(org.jbpm.test.wih.FirstErrorWorkItemHandler) DefaultProcessEventListener(org.kie.api.event.process.DefaultProcessEventListener) ProcessCompletedEvent(org.kie.api.event.process.ProcessCompletedEvent) Before(org.junit.Before)

Example 2 with FirstErrorWorkItemHandler

use of org.jbpm.test.wih.FirstErrorWorkItemHandler in project jbpm by kiegroup.

the class AsyncIntermediateCatchSignalTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    super.setUp();
    executorService = ExecutorServiceFactory.newExecutorService(getEmf());
    executorService.setInterval(0);
    executorService.setThreadPoolSize(3);
    addEnvironmentEntry("ExecutorService", executorService);
    addWorkItemHandler("SyncError", new FirstErrorWorkItemHandler());
    addProcessEventListener(new DefaultProcessEventListener() {

        @Override
        public void afterProcessCompleted(ProcessCompletedEvent event) {
            latch.countDown();
        }
    });
    executorService.init();
}
Also used : FirstErrorWorkItemHandler(org.jbpm.test.wih.FirstErrorWorkItemHandler) DefaultProcessEventListener(org.kie.api.event.process.DefaultProcessEventListener) ProcessCompletedEvent(org.kie.api.event.process.ProcessCompletedEvent) Before(org.junit.Before)

Example 3 with FirstErrorWorkItemHandler

use of org.jbpm.test.wih.FirstErrorWorkItemHandler in project jbpm by kiegroup.

the class AsyncNodesWithoutExecutionServiceTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    super.setUp();
    addWorkItemHandler("SyncError", new FirstErrorWorkItemHandler());
}
Also used : FirstErrorWorkItemHandler(org.jbpm.test.wih.FirstErrorWorkItemHandler) Before(org.junit.Before)

Example 4 with FirstErrorWorkItemHandler

use of org.jbpm.test.wih.FirstErrorWorkItemHandler in project jbpm by kiegroup.

the class AsyncThreadContinuationTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    super.setUp();
    executorService = ExecutorServiceFactory.newExecutorService(getEmf());
    executorService.setInterval(1);
    executorService.init();
    addEnvironmentEntry("ExecutorService", executorService);
    addWorkItemHandler("SyncError", new FirstErrorWorkItemHandler());
    addProcessEventListener(new DefaultProcessEventListener() {

        @Override
        public void afterProcessCompleted(ProcessCompletedEvent event) {
            System.out.println(event.getProcessInstance().getProcessId());
            if (event.getProcessInstance().getProcessId().equals(PROCESS_ATC)) {
                synchronized (LOCK_ATC) {
                    LOCK_ATC.notifyAll();
                }
            } else if (event.getProcessInstance().getProcessId().equals(PROCESS_IT)) {
                synchronized (LOCK_IT) {
                    LOCK_IT.notifyAll();
                }
            }
        }
    });
}
Also used : FirstErrorWorkItemHandler(org.jbpm.test.wih.FirstErrorWorkItemHandler) DefaultProcessEventListener(org.kie.api.event.process.DefaultProcessEventListener) ProcessCompletedEvent(org.kie.api.event.process.ProcessCompletedEvent) Before(org.junit.Before)

Example 5 with FirstErrorWorkItemHandler

use of org.jbpm.test.wih.FirstErrorWorkItemHandler in project jbpm by kiegroup.

the class AsyncThrowSignalTest method setUp.

@Before
@Override
public void setUp() throws Exception {
    super.setUp();
    executorService = ExecutorServiceFactory.newExecutorService(getEmf());
    executorService.setInterval(1);
    executorService.init();
    addEnvironmentEntry("ExecutorService", executorService);
    addWorkItemHandler("SyncError", new FirstErrorWorkItemHandler());
    addProcessEventListener(new DefaultProcessEventListener() {

        @Override
        public void afterProcessCompleted(ProcessCompletedEvent event) {
            synchronized (LOCK) {
                LOCK.notifyAll();
            }
        }
    });
}
Also used : FirstErrorWorkItemHandler(org.jbpm.test.wih.FirstErrorWorkItemHandler) DefaultProcessEventListener(org.kie.api.event.process.DefaultProcessEventListener) ProcessCompletedEvent(org.kie.api.event.process.ProcessCompletedEvent) Before(org.junit.Before)

Aggregations

FirstErrorWorkItemHandler (org.jbpm.test.wih.FirstErrorWorkItemHandler)5 Before (org.junit.Before)5 DefaultProcessEventListener (org.kie.api.event.process.DefaultProcessEventListener)4 ProcessCompletedEvent (org.kie.api.event.process.ProcessCompletedEvent)4