Esteban,
let's say I have several message throw events in one process. Those are all registered to a generic sendTaskHandler.
https://github.com/droolsjbpm/jbpm/blob/master/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/handler/SendTaskHandler.java
However, since there is no interface or operation connected, how would I trigger a suitable action for each particular message throw event?
As shown in this unit test:
KnowledgeBase kbase = createKnowledgeBase("BPMN2-IntermediateThrowEventMessage.bpmn2");
StatefulKnowledgeSession ksession = createKnowledgeSession(kbase);
ksession.getWorkItemManager().registerWorkItemHandler("Send Task", new SendTaskHandler());
Map<String, Object> params = new HashMap<String, Object>();
params.put("x", "MyValue");
ProcessInstance processInstance = ksession.startProcess("MessageIntermediateEvent", params);