<!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;">
    Subprocess transition in a fork is not working
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/FelixKJose">Felix Jose</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/546097#546097">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi All,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I am having a&#160; main JBPM process(helloworld.jpdl.xml) and in that having a fork of that one transition to a sub process and the other to a state node. And these to should transition to a join join1 node.&#160; When I started the process it sucessfully reaching the fork and both two transitions are reached. But As the subprocess contains a state node "<strong>printHelloWorld</strong>" the execution will wait in that. And meanwhile as the other transition node in the fork is a state node (<strong>Being1</strong>) it also wait in that node.</p><p><span style="text-decoration: underline;"><strong>snippet of Main process(helloworld.jpdl.xml)</strong></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;fork g="101,278,80,40" name="printHelloWorld"&gt;<br/>&#160; &lt;transition g="56,193:-39,-18" name="Being1" to="Being1"/&gt;<br/>&#160; &lt;transition g="137,177:24,8" name="review" to="review"/&gt;<br/>&#160; <br/> &lt;/fork&gt;<br/> &lt;join g="855,204,80,40" name="join1"&gt;<br/>&#160; &lt;transition to="printHelloWorld2"/&gt;<br/> &lt;/join&gt;<br/>&#160;&#160;&#160;&#160; &lt;state name="Being1" g="0,0,80,40"&gt;<br/>&#160; &lt;transition to="join1" g="877,666:"/&gt;-<strong>-------Other execution is active at this node. Waiting for an external signal</strong><br/> &lt;/state&gt;<br/> &lt;sub-process name="review" sub-process-key="SubProc" g="0,0,80,40"&gt;<br/>&#160; &lt;transition to="join1" g="877,666:"/&gt;<br/> &lt;/sub-process&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong style="text-decoration: underline; ">subporcess (SubPoc.jpdl.xml)</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;process name="SubProc" xmlns="<a class="jive-link-external-small" href="http://jbpm.org/4.3/jpdl">http://jbpm.org/4.3/jpdl</a>"&gt;<br/> &lt;start g="372,19,80,40"&gt;<br/>&#160; &lt;transition to="printHelloWorld"/&gt;<br/> &lt;/start&gt;<br/>&#160;&#160;&#160; &lt;state name="printHelloWorld" g="0,0,80,40"&gt;------<strong>Subprocess execution is waiting in This node. Waiting for an external signal.</strong><br/>&#160; &lt;transition name="printHelloWorld1" to="printHelloWorld1" g="877,666:"/&gt;<br/> &lt;/state&gt;<br/> &lt;java g="539,206,138,40" method="printHelloWorld" name="printHelloWorld1"&gt;<br/>&#160; &lt;transition g="606,516:-39,-18" name="theEnd" to="theEnd"/&gt;<br/> &lt;/java&gt;<br/> &lt;end g="369,491,80,40" name="theEnd"/&gt;<br/>&lt;/process&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I have used <strong>processInstance.getExecutions()</strong> which gives the active executions and the result is:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>[execution[helloWorld.13.Being1], execution[helloWorld.13.review]]</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Then by using<strong> openExecutio.getSubProcessInstance().getId();</strong> I find out the subprocess instance id and is<strong> [SubProc.21].</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Then I signaled the subprocess using <strong>executionService.signalExecutionById(id,"printHelloWorld1");</strong> And it sucessfully transitioned and it prints :</p><p><strong>&lt;----------------&gt;</strong></p><p><strong>&#160;&#160; HELLO FELIX!</strong></p><p><strong>&lt;----------------&gt;</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>So the subprocess sucessfully <strong>completed</strong>. But when I check activeactivity name in the subprcess it still shows <strong>printHelloWorld state node (</strong>by using <strong>openExecutio.getSubProcessInstance().findActiveActivityNames()---o/p is <span style="font-size: 10pt; color: #000000; font-family: Courier New;">--[</span><span style="font-size: 10pt; color: #000000; font-family: Courier New;">printHelloWorld</span><span style="font-size: 10pt; color: #000000; font-family: Courier New;">]</span>)</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>And also when I checked active executions using <strong>processInstance.getExecutions() it still gives:</strong></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>[execution[helloWorld.13.Being1], execution[helloWorld.13.review]]</strong> that means both two forked transitions are in <strong>wait</strong> state.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>So my doubt is how can I transition the subprocess fron one state to another instead of using <strong>executionService.signalExecutionById(id,"printHelloWorld1");?</strong></p><p>I have attached the sample application with this. Can you please give a solution as soon as possible?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><strong>Thank You and Regards,</strong></p><p><strong>Felix K Jose</strong></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/546097#546097">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>