Search in sources :

Example 1 with NotAvailableGoodsReport

use of org.jbpm.bpmn2.objects.NotAvailableGoodsReport in project jbpm by kiegroup.

the class StartEventTest method testSignalStartWithCustomEvent.

@Test
public void testSignalStartWithCustomEvent() throws Exception {
    KieBase kbase = createKnowledgeBase("BPMN2-SingalStartWithCustomEvent.bpmn2");
    ksession = createKnowledgeSession(kbase);
    final List<ProcessInstance> list = new ArrayList<ProcessInstance>();
    ksession.addEventListener(new DefaultProcessEventListener() {

        public void beforeProcessStarted(ProcessStartedEvent event) {
            list.add(event.getProcessInstance());
        }
    });
    NotAvailableGoodsReport report = new NotAvailableGoodsReport("test");
    ksession.signalEvent("SignalNotAvailableGoods", report);
    assertThat(getNumberOfProcessInstances("org.jbpm.example.SignalObjectProcess")).isEqualTo(1);
    assertThat(list.size()).isEqualTo(1);
    assertProcessVarValue(list.get(0), "report", "NotAvailableGoodsReport{type:test}");
}
Also used : NotAvailableGoodsReport(org.jbpm.bpmn2.objects.NotAvailableGoodsReport) KieBase(org.kie.api.KieBase) ArrayList(java.util.ArrayList) ProcessStartedEvent(org.kie.api.event.process.ProcessStartedEvent) DefaultProcessEventListener(org.kie.api.event.process.DefaultProcessEventListener) ProcessInstance(org.kie.api.runtime.process.ProcessInstance) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)1 NotAvailableGoodsReport (org.jbpm.bpmn2.objects.NotAvailableGoodsReport)1 Test (org.junit.Test)1 KieBase (org.kie.api.KieBase)1 DefaultProcessEventListener (org.kie.api.event.process.DefaultProcessEventListener)1 ProcessStartedEvent (org.kie.api.event.process.ProcessStartedEvent)1 ProcessInstance (org.kie.api.runtime.process.ProcessInstance)1