<!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">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;">
    JBPM 4.3 - signalled state remains active - bug or incorrect usage?
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/jnad">Jan Nad</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/541111#541111">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p><span>The same problem seems to be described here </span><a class="jive-link-external-small" href="http://www.techienuggets.com/Comments?tx=100474" target="_blank">http://www.techienuggets.com/Comments?tx=100474</a><span>. I've not found any other references to it (or solutions).</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I have the following process definition:</p><p><a href="http://community.jboss.org/servlet/JiveServlet/showImage/2675/TestProcess.png"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/2675/450-283/TestProcess.png </span></a>When I signal execution in D1, D2 becomes active (as reported by findActiveActivityNames), the problem is that D1 remains active as well. Is this a bug or did I get somethig wrong? It's been suggested this might be caused by wrong fork-join nesting but this doesn't help in my case.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-size: 8pt; font-family: courier new,courier; "><span>&lt;process name="TestProcess" xmlns="</span><a class="jive-link-external-small" href="http://jbpm.org/4.3/jpdl" target="_blank">http://jbpm.org/4.3/jpdl</a><span>"&gt;</span><br/>&#160;&#160; &lt;start name="start1"&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;transition to="fork1"/&gt;<br/>&#160;&#160; &lt;/start&gt;<br/>&#160;&#160; &lt;state name="A"&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;transition to="fork2"/&gt;<br/>&#160;&#160; &lt;/state&gt;<br/>&#160;&#160; &lt;state name="C1"&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;transition to="C2"/&gt;<br/>&#160;&#160; &lt;/state&gt;<br/>&#160;&#160; &lt;state name="C2"&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;transition to="join2"/&gt;<br/>&#160;&#160; &lt;/state&gt;<br/>&#160;&#160; &lt;state name="D1"&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;transition to="D2"/&gt;<br/>&#160;&#160; &lt;/state&gt;<br/>&#160;&#160; &lt;state name="D2"&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;transition to="join2"/&gt;<br/>&#160;&#160; &lt;/state&gt;<br/>&#160;&#160; &lt;fork name="fork2"&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;transition to="D1"/&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;transition to="C1"/&gt;<br/>&#160;&#160; &lt;/fork&gt;<br/>&#160;&#160; &lt;end name="finihed"/&gt;<br/>&#160;&#160; &lt;fork name="fork1"&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;transition to="A"/&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;transition to="B"/&gt;<br/>&#160;&#160; &lt;/fork&gt;<br/>&#160;&#160; &lt;state name="B"&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;transition to="join1"/&gt;<br/>&#160;&#160; &lt;/state&gt;<br/>&#160;&#160; &lt;join name="join2""&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;transition to="join1"/&gt;<br/>&#160;&#160; &lt;/join&gt;<br/>&#160;&#160; &lt;join name="join1"&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;transition to="E"/&gt;<br/>&#160;&#160; &lt;/join&gt;<br/>&#160;&#160; &lt;state name="E"&gt;<br/>&#160;&#160;&#160;&#160;&#160; &lt;transition to="end"/&gt;<br/>&#160;&#160; &lt;/state&gt;<br/>&#160;&#160; &lt;end name="end"/&gt;<br/>&lt;/process&gt;</span></p><p><span style="font-family: courier new,courier;"><br/></span></p><p><span style="font-size: 10pt; font-family: courier new,courier; ">public void test() {</span></p><p><span style="font-size: 10pt; font-family: courier new,courier; ">&#160;&#160;&#160;&#160;&#160;&#160;&#160; repositoryService.createDeployment()</span></p><p><span style="font-size: 10pt; font-family: courier new,courier; ">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; .addResourceFromClasspath("pmlprocesses/TestProcess.jpdl.xml")</span></p><p><span style="font-size: 10pt; font-family: courier new,courier; ">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; .deploy();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br/>&#160;&#160; <strong>&#160;&#160;&#160;&#160; ProcessInstance processInstance = executionService.startProcessInstanceByKey("TestProcess");<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; String pid = processInstance.getId();</strong><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println(processInstance.findActiveActivityNames().toString());<strong><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; String executionId = processInstance.findActiveExecutionIn("B").getId();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; processInstance = executionService.signalExecutionById(executionId);</strong><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println(processInstance.findActiveActivityNames().toString());</span></p><p><span style="font-size: 10pt; font-family: courier new,courier; "> <strong>&#160;&#160;&#160;&#160;&#160;&#160; executionId = processInstance.findActiveExecutionIn("A").getId();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; processInstance = executionService.signalExecutionById(executionId);</strong><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println(processInstance.findActiveActivityNames().toString());<strong><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; executionId = processInstance.findActiveExecutionIn("C1").getId();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; processInstance = executionService.signalExecutionById(executionId);</strong><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println(processInstance.findActiveActivityNames().toString());<br/>&#160;&#160;&#160;&#160;&#160; <strong>&#160; executionId = processInstance.findActiveExecutionIn("C2").getId();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; processInstance = executionService.signalExecutionById(executionId);</strong><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println(processInstance.findActiveActivityNames().toString());<br/>&#160;&#160;&#160;&#160;&#160; <strong>&#160; executionId = processInstance.findActiveExecutionIn("D1").getId();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; processInstance = executionService.signalExecutionById(executionId);</strong><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println(processInstance.findActiveActivityNames().toString());<br/>&#160;&#160;&#160;&#160;&#160; <strong>&#160; executionId = processInstance.findActiveExecutionIn("D2").getId();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; processInstance = executionService.signalExecutionById(executionId);</strong><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println(processInstance.findActiveActivityNames().toString());<strong><br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; executionId = processInstance.findActiveExecutionIn("E").getId();<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; processInstance = executionService.signalExecutionById(executionId);</strong></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="font-size: 10pt; font-family: courier new,courier; ">&#160;&#160;&#160; <strong>&#160;&#160;&#160; assertNull("execution "+pid+" should not exist", executionService.findExecutionById(pid)); </strong></span></p><p><span style="font-size: 10pt; font-family: courier new,courier; ">}</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Output:</p><p><strong>[A, B]<br/>[A]<br/>[C1, D1]<br/>[C2, D1]<br/>[D1]<br/>[D2, D1]<br/>[E, D1]</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The process seems to have finished execution.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks for any ideas.</p></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/541111#541111">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>