Search in sources :

Example 1 with ServiceTaskHandler

use of org.jbpm.process.workitem.bpmn2.ServiceTaskHandler in project jbpm by kiegroup.

the class AsyncThreadIsolationTest method setUp.

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

        @Override
        public void beforeNodeTriggered(ProcessNodeTriggeredEvent event) {
            if (event.getNodeInstance().getNodeName().equals("Async Hello Service Exception")) {
                if (firstAttempt) {
                    firstAttempt = false;
                } else {
                    synchronized (LOCK) {
                        LOCK.notifyAll();
                    }
                }
            }
        }
    });
}
Also used : ServiceTaskHandler(org.jbpm.process.workitem.bpmn2.ServiceTaskHandler) DefaultProcessEventListener(org.kie.api.event.process.DefaultProcessEventListener) ProcessNodeTriggeredEvent(org.kie.api.event.process.ProcessNodeTriggeredEvent) Before(org.junit.Before)

Aggregations

ServiceTaskHandler (org.jbpm.process.workitem.bpmn2.ServiceTaskHandler)1 Before (org.junit.Before)1 DefaultProcessEventListener (org.kie.api.event.process.DefaultProcessEventListener)1 ProcessNodeTriggeredEvent (org.kie.api.event.process.ProcessNodeTriggeredEvent)1