<!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="https://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;">
Old JBPM (ver 3.2.7) non-logical exception "org.jbpm.JbpmException: transition 'no-work-done' does not exist on Node(preScan)"
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/d_edery">David Edery</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/717230#717230">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</p><p>We are using JBPM 3.2.7 in our large-scale application for a long time now.</p><p>Recently, due to race-conditions with the DB commit we have decided to move from persistent mode (in which all the process-definitions, process-instances etc... were stored in the DB) to non-persistent that works in the following flow:</p><ol><li style="text-align: start;">We read all the .xml files containing process definitions.</li><li style="text-align: start;">For each .xml file we create a process definition and store it in a static map.</li><li style="text-align: start;">When the user wants to activate a flow (it's usually the same flow on multiple targets) - <strong>we create a new ProcessInstance based on the same instance of ProcessDefinition </strong>(this might explain the phenomena but we didn't see how from the code).</li><li style="text-align: start;">Each thread in a dedicated thread pool takes one ProcessInstance and activates it (via .signal).</li><li style="text-align: start;">Each action calls the .signal (with or without transition name) in the end of its business logic - thus creating a synchronized workflow.</li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="text-align: start;">Recently we have encountered a problem (it occurred only one time) that caused failure in some of the targets (ProcessInstances).</p><p style="text-align: start;">The exception was (full stack-trace attached to the discussion, highlighted lines describe the flow):</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong>org.jbpm.JbpmException: transition 'no-work-done' does not exist on Node(preScan)</strong></p><p>    at org.jbpm.graph.exe.<strong>Token.signal</strong>(Token.java:170)</p><p>    at com.yyyy.nms.massconfig.swdownload.<strong>PreScanAction.run</strong>(PreScanAction.java:42)</p><p>    at com.yyyy.nms.massconfig.common.<strong>BaseAction.execute</strong>(BaseAction.java:71)</p><p>    at org.jbpm.graph.def.Action.execute(Action.java:137)</p><p>    at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:280)</p><p>    at org.jbpm.graph.def.Node.execute(Node.java:395)</p><p>    at org.jbpm.graph.def.Node.enter(Node.java:375)</p><p>    at org.jbpm.graph.def.Transition.take(Transition.java:151)</p><p>    at org.jbpm.graph.def.Node.leave(Node.java:453)</p><p>    at org.jbpm.graph.exe.Token.signal(Token.java:214)</p><p>    at org.jbpm.graph.exe.<strong>Token.signal</strong>(Token.java:143)</p><p>    at com.yyyy.nms.massconfig.common.<strong>FirstWorkflowAction.run</strong>(FirstWorkflowAction.java:94)</p><p>    at com.yyyy.nms.massconfig.common.<strong>BaseAction.execute</strong>(BaseAction.java:71)</p><p>    at org.jbpm.graph.def.Action.execute(Action.java:137)</p><p>    at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:280)</p><p>    at org.jbpm.graph.def.Node.execute(Node.java:395)</p><p>    at org.jbpm.graph.def.Node.enter(Node.java:375)</p><p>    at org.jbpm.graph.def.Transition.take(Transition.java:151)</p><p>    at org.jbpm.graph.def.Node.leave(Node.java:453)</p><p>    at org.jbpm.graph.node.StartState.leave(StartState.java:78)</p><p>    at org.jbpm.graph.exe.Token.signal(Token.java:214)</p><p>    at org.jbpm.graph.exe.<strong>Token.signal</strong>(Token.java:143)</p><p>    at org.jbpm.graph.exe<strong>.ProcessInstance.signal</strong>(ProcessInstance.java:287)</p><p>    at com.yyyy.nms.jbpmworkflow.<strong>JbpmWorkflowInvoker</strong>.startNonPersistentWorkflow(JbpmWorkflowInvoker.java:271)</p><p>    at com.yyyy.nms.jbpmworkflow.<strong>JbpmWorkflowInvoker</strong>.startWorkflow(JbpmWorkflowInvoker.java:350)</p><p>    at com.yyyy.nms.jbpmworkflow.StartWorkflowMDB.signalWorkflow(StartWorkflowMDB.java:101)</p><p>    at com.yyyy.nms.jbpmworkflow.<strong>StartWorkflowMDB</strong>.handleMessage(StartWorkflowMDB.java:85)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>In the .xml file from which the related ProcessDefinition was read looks like this (in the relevant part):</p><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"><exception-handler></span>
     <span class="jive-xml-tag"><action class="com.yyyy.nms.massconfig.common.ExceptionAction" /></span>
<span class="jive-xml-tag"></exception-handler></span>
<span class="jive-xml-tag"><start-state></span>
     <span class="jive-xml-tag"><transition to="check-suspend-or-abort"></span><span class="jive-xml-tag"></transition></span>
<span class="jive-xml-tag"></start-state></span>
<span class="jive-xml-tag"><node name="check-suspend-or-abort"></span>
     <span class="jive-xml-tag"><action class="com.yyyy.nms.massconfig.common.FirstWorkflowAction" /></span>
     <span class="jive-xml-tag"><transition to="preScan"/></span>
     <span class="jive-xml-tag"><transition to="error" name="error"/></span>
     <span class="jive-xml-tag"><transition to="suspended" name="suspended"/></span>
     <span class="jive-xml-tag"><transition to="aborted" name="aborted"/></span>
<span class="jive-xml-tag"></node></span>
<span class="jive-xml-tag"><node name="preScan" description="Pre-upgrade Scan" shouldField="preScan"></span>
      <span class="jive-xml-tag"><action class="com.yyyy.nms.massconfig.swdownload.PreScanAction" /></span>
     <span class="jive-xml-tag"><event type="node-enter"></span>
          <span class="jive-xml-tag"><action class="com.yyyy.nms.massconfig.common.StepStartAction" /></span>
     <span class="jive-xml-tag"></event></span>
     <span class="jive-xml-tag"><transition to="acquireFtpForUpload"></span>
          <span class="jive-xml-tag"><action class="com.yyyy.nms.massconfig.common.StepDoneAction" /></span>
     <span class="jive-xml-tag"></transition></span>
     <span class="jive-xml-tag"><transition to="acquireFtpForUpload" name="no-work-done"></span>
          <span class="jive-xml-tag"><action class="com.yyyy.nms.massconfig.common.StepSkippedAction" /></span>
     <span class="jive-xml-tag"></transition></span>
     <span class="jive-xml-tag"><transition to="error" name="error"/></span>
     <span class="jive-xml-tag"><transition to="suspended" name="suspended"/></span>
     <span class="jive-xml-tag"><transition to="aborted" name="aborted"/></span>
<span class="jive-xml-tag"></node></span>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>As you can see, if we are in the "preScan" node - we definitely have the "no-work-done" transition.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The scenario that produced this exception contained 40 process instances (=40 different targets) based on the same ProcessDefinition instance. Out of which 7 targets failed on this exception and the rest (which went through the same nodes and transitions) completed successfully (before and after the 7 failed).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The only clue to a possible problem was that the JBPM exception thrown for all 7 targets was thrown <strong>at the same exact time </strong>(same millisecond even). Meaning - all 7 tried to perform the .signal("no-work-done") in the PreScanAction at the same exact time.</p><p>We have generated the same scenario on our development environment (using CountDownLatch in the prior to the .signal("no-work-done")) with 10 targets that wait together and all of them call the .signal("no-work-done") in the same exact millisecond - the failure was not reproduced.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Our question is - did you encounter such scenario? If so - was it fixed in newer versions? can we bypass it? (I thought about creating a new ProcessDefinition per ProcessInstance - this will cost a lot in terms of memory consumption and CPU load - but since I couldn't reproduce the problem, I'm not sure that it will solve it).</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Oh, we create the ProcessDefinitions map during server load. We don't change them after the creation of the map.</p><p>As you can see in the attached screenshot (from LogMX) - this is how it looks like, 7 different threads throw the same exception on the same time.</p><p><a href="https://community.jboss.org/servlet/JiveServlet/showImage/2-717230-17993/transitionProblem.GIF"><span> https://community.jboss.org/servlet/JiveServlet/downloadImage/2-717230-17993/450-133/transitionProblem.GIF </span></a></p><p>Thank you for your time.</p><p>Sincerely</p><p>David Edery.</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/717230#717230">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="https://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>