use of org.camunda.bpm.engine.cdi.BusinessProcessEvent in project camunda-bpm-platform by camunda.
the class EventNotificationTest method testMultiInstanceEventsAfterExternalTrigger.
@Test
@Deployment
public void testMultiInstanceEventsAfterExternalTrigger() {
runtimeService.startProcessInstanceByKey("process");
TestEventListener listenerBean = getBeanInstance(TestEventListener.class);
listenerBean.reset();
List<Task> tasks = taskService.createTaskQuery().list();
assertEquals(3, tasks.size());
for (Task task : tasks) {
taskService.complete(task.getId());
}
// 6: three user task instances (complete + end)
// 1: one mi body instance (end)
// 1: one sequence flow instance (take)
// 2: one end event instance (start + end)
// = 5
Set<BusinessProcessEvent> eventsReceived = listenerBean.getEventsReceived();
assertThat(eventsReceived.size(), is(10));
}
use of org.camunda.bpm.engine.cdi.BusinessProcessEvent in project camunda-bpm-platform by camunda.
the class CdiEventListener method notify.
public void notify(DelegateExecution execution) throws Exception {
// test whether cdi is setup correctly. (if not, just do not deliver the event)
if (!testCdiSetup()) {
return;
}
BusinessProcessEvent event = createEvent(execution);
Annotation[] qualifiers = getQualifiers(event);
getBeanManager().fireEvent(event, qualifiers);
}
use of org.camunda.bpm.engine.cdi.BusinessProcessEvent in project camunda-bpm-platform by camunda.
the class CdiEventListener method notify.
public void notify(DelegateTask task) {
// test whether cdi is setup correctly. (if not, just do not deliver the event)
if (!testCdiSetup()) {
return;
}
BusinessProcessEvent event = createEvent(task);
Annotation[] qualifiers = getQualifiers(event);
getBeanManager().fireEvent(event, qualifiers);
}
Aggregations