<!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;">
Why "TerminateEndEvent" terminator process does not work, is it jBPMN4.4 the Bug it?
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/bcanew">Vincent He</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/577697#577697">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p><a href="http://community.jboss.org/servlet/JiveServlet/showImage/2-577697-10791/subProcessTest.png"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/2-577697-10791/450-302/subProcessTest.png </span></a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><process id="subProcessTest1" name="subProcessTest1"></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><startEvent id="Start_1" name="Start" /></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><userTask id="Task3" name="Task3"/></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><endEvent id="End_1" name="End_1" /></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><subProcess id="SubProcessA" name="SubProcessA"></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><startEvent id="Start_2" name="Start" /></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><userTask id="Task1" name="Task1"/></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><userTask id="Task2" name="Task2"/></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><parallelGateway id="Gateway_1" name="Gateway" /></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><endEvent id="End_2" name="End_2" /></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><endEvent id="End_3" name="End_3"></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><terminateEventDefinition id="ted1"/></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"></endEvent></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><sequenceFlow id="SequenceFlow_3" sourceRef="Start_2"</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">targetRef="Gateway_1" /></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><sequenceFlow id="SequenceFlow_4" sourceRef="Gateway_1"</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">targetRef="Task1" /></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><sequenceFlow id="SequenceFlow_5" sourceRef="Gateway_1"</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">targetRef="Task2" /></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><sequenceFlow id="SequenceFlow_6" sourceRef="Task1"</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">targetRef="End_2" /></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><sequenceFlow id="SequenceFlow_7" sourceRef="Task2"</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">targetRef="End_3" /></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"></subProcess></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><sequenceFlow id="SequenceFlow_1" sourceRef="Start_1"</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">targetRef="SubProcessA" /></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><sequenceFlow id="SequenceFlow_8" sourceRef="SubProcessA"</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">targetRef="Task3" /></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><sequenceFlow id="SequenceFlow_2" sourceRef="Task3"</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">targetRef="End_1" /></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"></process></div><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-xml">     <span class="jive-xml-tag"><process id="subProcessTest1" name="subProcessTest1"></span>
          <span class="jive-xml-tag"><startEvent id="Start_1" name="Start" /></span>
          <span class="jive-xml-tag"><userTask id="Task3" name="Task3"/></span>
          <span class="jive-xml-tag"><endEvent id="End_1" name="End_1" /></span>
          <span class="jive-xml-tag"><subProcess id="SubProcessA" name="SubProcessA"></span>
               <span class="jive-xml-tag"><startEvent id="Start_2" name="Start" /></span>
               <span class="jive-xml-tag"><userTask id="Task1" name="Task1"/></span>
               <span class="jive-xml-tag"><userTask id="Task2" name="Task2"/></span>
               <span class="jive-xml-tag"><parallelGateway id="Gateway_1" name="Gateway" /></span>
               <span class="jive-xml-tag"><endEvent id="End_2" name="End_2" /></span>
               <span class="jive-xml-tag"><endEvent id="End_3" name="End_3"></span>
                    <span class="jive-xml-tag"><terminateEventDefinition id="ted1"/></span>
               <span class="jive-xml-tag"></endEvent></span>
               <span class="jive-xml-tag"><sequenceFlow id="SequenceFlow_3" sourceRef="Start_2"
                    targetRef="Gateway_1" /></span>
               <span class="jive-xml-tag"><sequenceFlow id="SequenceFlow_4" sourceRef="Gateway_1"
                    targetRef="Task1" /></span>
               <span class="jive-xml-tag"><sequenceFlow id="SequenceFlow_5" sourceRef="Gateway_1"
                    targetRef="Task2" /></span>
               <span class="jive-xml-tag"><sequenceFlow id="SequenceFlow_6" sourceRef="Task1"
                    targetRef="End_2" /></span>
               <span class="jive-xml-tag"><sequenceFlow id="SequenceFlow_7" sourceRef="Task2"
                    targetRef="End_3" /></span>
          <span class="jive-xml-tag"></subProcess></span>
          <span class="jive-xml-tag"><sequenceFlow id="SequenceFlow_1" sourceRef="Start_1"
               targetRef="SubProcessA" /></span>
          <span class="jive-xml-tag"><sequenceFlow id="SequenceFlow_8" sourceRef="SubProcessA"
               targetRef="Task3" /></span>
          <span class="jive-xml-tag"><sequenceFlow id="SequenceFlow_2" sourceRef="Task3"
               targetRef="End_1" /></span>
     <span class="jive-xml-tag"></process></span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-java">     ProcessInstance processInstance = executionService.startProcessInstanceByKey(<font color="red">"subProcessTest1"</font>);
     Task task1 = taskService.createTaskQuery().activityName(<font color="red">"Task1"</font>).uniqueResult();
     assertNotNull(task1);
     Task task2 = taskService.createTaskQuery().activityName(<font color="red">"Task2"</font>).uniqueResult();
     assertNotNull(task2);
 
     taskService.completeTask(task2.getId());
     List<Task> list = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
     Task reviewTask1 = taskService.createTaskQuery().activityName(<font color="red">"Task1"</font>).uniqueResult();
     assertNull(reviewTask1);<font color="darkgreen">//  <----Here, do not pass! Why???</font>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="font-family: arial, sans-serif; font-size: 24px; color: #000000;"><span class="hps" title="点击可显示其他翻译">I used</span> <span class="hps" title="点击可显示其他翻译">version is</span> <span class="hps" title="点击可显示其他翻译">jBPM4.4,</span> <span class="hps" title="点击可显示其他翻译">hope</span> <span class="hps" title="点击可显示其他翻译">for help...</span></span></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/577697#577697">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>