<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    Message Event (throw and catch problem)
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/krishanps">krishanps</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/643239#643239">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><div><span style="border-collapse: separate; color: #000000; font-family: arial,helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: 10pt;">Merry X-Mas, hope you all enjoyed also the holidays.</span></div><div><span style="border-collapse: separate; color: #000000; font-family: arial,helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><br/></span></div><div><span style="border-collapse: separate; color: #000000; font-family: arial,helvetica,sans-serif; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: 10pt;">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". <span style="color: #010101;">If I instead uses signal events in the way that I replace both times the line EventMessage.bpmn2 it works properly.<br/></span></span></div><div align="left"><span style="color: #010101; font-family: 'Courier New'; font-size: 13px;"><br/></span></div><div align="left"><span style="color: #010101; font-family: 'Courier New'; font-size: 13px;"> &lt;messageEventDefinition messageRef="_8_Message"/&gt; </span><span style="color: #010101; font-size: 13px;">with the line </span><span style="color: #010101; font-family: 'Courier New'; font-size: 13px;"> &lt;signalEventDefinition signalRef="_8_Message"/&gt;</span></div><div align="left"><span style="color: #010101; font-family: 'Courier New'; font-size: 13px;"><br/></span></div><div align="left"><span style="color: #010101; font-size: 13px; font-family: arial,helvetica,sans-serif;">Can you please tell me what could be the problem and how I can fix it?</span></div><div align="left"> </div><div align="left"><span style="color: #010101; font-family: arial,helvetica,sans-serif;">Thank you very much<br/></span></div><div align="left"><span style="color: #010101; font-family: arial,helvetica,sans-serif;"><br/></span></div><div align="left"><span style="color: #010101; font-family: arial,helvetica,sans-serif;">My *.bpmn file:</span></div><div align="left"> </div><div align="left"> </div><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; &amp;lt;!-- Throw a message event <del>&amp;gt;&#160;&#160;&#160; &amp;lt;intermediateThrowEvent id="_7" name="Script" &amp;gt;&#160;&#160;&#160;&#160;&#160; &amp;lt;dataInput id="_7_Input" /&amp;gt;&#160;&#160;&#160;&#160;&#160; &amp;lt;dataInputAssociation&amp;gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &amp;lt;sourceRef&amp;gt;x&amp;lt;/sourceRef&amp;gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &amp;lt;targetRef&amp;gt;_7_Input&amp;lt;/targetRef&amp;gt;&#160;&#160;&#160;&#160;&#160; &amp;lt;/dataInputAssociation&amp;gt;&#160;&#160;&#160;&#160;&#160; &amp;lt;inputSet&amp;gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &amp;lt;dataInputRefs&amp;gt;_7_Input&amp;lt;/dataInputRefs&amp;gt;&#160;&#160;&#160;&#160;&#160; &amp;lt;/inputSet&amp;gt;&#160;&#160;&#160;&#160;&#160; &amp;lt;messageEventDefinition messageRef="_8_Message"/&amp;gt;&#160;&#160;&#160; &amp;lt;/intermediateThrowEvent&amp;gt; &#160;&#160; &#160;&#160;&#160; &amp;lt;!</del> Catch a message event --&amp;gt;&#160;&#160;&#160;&#160; </p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><div align="left"><span style="color: #010101; font-family: arial,helvetica,sans-serif;"><br/></span></div><div align="left"> </div><div align="left"> </div><div align="left"><span style="color: #010101; font-family: arial,helvetica,sans-serif;">My *.java file:</span></div><div align="left"> </div><div align="left"><span style="font-family: arial,helvetica,sans-serif;"><span style="color: #010101;"><br/></span><p>&#160;&#160;&#160;&#160;&#160; public static final void main(String[] args) {&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; try {&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // load up the knowledge base&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; KnowledgeBase kbase = readKnowledgeBase();&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; KnowledgeRuntimeLogger logger = KnowledgeRuntimeLoggerFactory.newFileLogger(ksession, "test");&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ksession.getWorkItemManager().registerWorkItemHandler("Human Task", new DoNothingWorkItemHandler());&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ksession.getWorkItemManager().registerWorkItemHandler("Send Task", new SendTaskHandler());&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Map&amp;lt;String, Object&amp;gt; params = new HashMap&amp;lt;String, Object&amp;gt;();&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; params.put("x", "MyValue");&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; params.put("y", "OtherValue");&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; // start a new process instance&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; ksession.startProcess("IntermediateCatchEvent", params);&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; logger.close();&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; } catch (Throwable t) {&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; t.printStackTrace();&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; }&#160;&#160;&#160;&#160;&#160; }&#160;&#160;&#160;&#160;&#160; private static KnowledgeBase readKnowledgeBase() throws Exception {&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; kbuilder.add(ResourceFactory.newClassPathResource("EventMessage.bpmn2"), ResourceType.BPMN2);&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; return kbuilder.newKnowledgeBase();&#160;&#160;&#160;&#160;&#160; }</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p></span></div><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><div class="mcePaste" id="_mcePaste" style="position: absolute; left: 0px; top: 0px; width: 849px; height: 428px; overflow: hidden; visibility: hidden;"><div align="left"><span style="widows: 2; text-indent: 0px; letter-spacing: normal; font-variant: normal; text-align: -webkit-auto; font-style: normal; font-weight: normal; line-height: normal; border-collapse: separate; orphans: 2; color: #010101; text-transform: none; font-size: 10pt; white-space: normal; font-family: Courier New; word-spacing: 0px;">If I instead replace the both times the line </span></div><div align="left"><span style="color: #010101; font-family: 'Courier New'; font-size: 13px;"><br/></span></div><div align="left"><span style="color: #010101; font-family: 'Courier New'; font-size: 13px;"> &lt;messageEventDefinition messageRef="_8_Message"/&gt;</span></div><div align="left"><span style="color: #010101; font-family: 'Courier New'; font-size: 13px;"><br/></span></div><div align="left"><span style="color: #010101; font-family: 'Courier New'; font-size: 13px;">with the line </span><span style="color: #010101; font-family: 'Courier New'; font-size: 13px;"> &lt;signalEventDefinition signalRef="_8_Message"/&gt;</span></div></div></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/643239#643239">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>