[jboss-user] [jBPM] - Message Event (throw and catch problem)

krishanps do-not-reply at jboss.com
Mon Dec 26 17:03:39 EST 2011


krishanps [http://community.jboss.org/people/krishanps] created the discussion

"Message Event (throw and catch problem)"

To view the discussion, visit: http://community.jboss.org/message/643239#643239

--------------------------------------------------------------
Merry X-Mas, hope you all enjoyed also the holidays.


I have short question, when I use message event to throw and catch it doesn't work, I only get as a output "Sending message: MyValue". If I instead uses signal events in the way that I replace both times the line EventMessage.bpmn2 it works properly.



 <messageEventDefinition messageRef="_8_Message"/> with the line  <signalEventDefinition signalRef="_8_Message"/>


Can you please tell me what could be the problem and how I can fix it?
 
Thank you very much



My *.bpmn file:
 
 

    &lt;!-- Throw a message event --&gt;    &lt;intermediateThrowEvent id="_7" name="Script" &gt;      &lt;dataInput id="_7_Input" /&gt;      &lt;dataInputAssociation&gt;            &lt;sourceRef&gt;x&lt;/sourceRef&gt;            &lt;targetRef&gt;_7_Input&lt;/targetRef&gt;      &lt;/dataInputAssociation&gt;      &lt;inputSet&gt;            &lt;dataInputRefs&gt;_7_Input&lt;/dataInputRefs&gt;      &lt;/inputSet&gt;      &lt;messageEventDefinition messageRef="_8_Message"/&gt;    &lt;/intermediateThrowEvent&gt;        &lt;!-- Catch a message event --&gt;     



 
 
My *.java file:
 

      public static final void main(String[] args) {            try {                  // load up the knowledge base                  KnowledgeBase kbase = readKnowledgeBase();                  StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();                  KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, "test");                  ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new DoNothingWorkItemHandler());                  ksession.getWorkItemManager().registerWorkItemHandler("Send Task", new SendTaskHandler());                  Map&lt;String, Object&gt; params = new HashMap&lt;String, Object&gt;();                  params.put("x", "MyValue");                  params.put("y", "OtherValue");                               // start a new process instance                  ksession.startProcess("IntermediateCatchEvent", params);                                    logger.close();            } catch (Throwable t) {                  t.printStackTrace();            }      }      private static KnowledgeBase readKnowledgeBase() throws Exception {            KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();            kbuilder.add(ResourceFactory.newClassPathResource("EventMessage.bpmn2"), ResourceType.BPMN2);            return kbuilder.newKnowledgeBase();      }



If I instead replace the both times the line 


 <messageEventDefinition messageRef="_8_Message"/>


with the line  <signalEventDefinition signalRef="_8_Message"/>
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/643239#643239]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111226/938c7149/attachment-0001.html 


More information about the jboss-user mailing list