<!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;">
fail to fire a rule task~~ frustrated
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/taitung.wilbert">Guo-Guang Chiou</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/631470#631470">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-631470-17155/testrule-image.png"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/2-631470-17155/450-367/testrule-image.png </span></a></p><p>I defined a process as the above.</p><p>between 2 script task there is a rule task.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>here is my rule content. it's very simple.</p><p>============================================================</p><p><span style="color: #000080;">#created on: 2011/10/11</span></p><p><span style="color: #000080;">#list any import classes here.</span></p><p><span style="color: #000080;">import org.drools.runtime.process.WorkflowProcessInstance;</span></p><p><span style="color: #000080;">#declare any global variables here  </span></p><p><span style="color: #000080;">rule rule1 </span></p><p><span style="color: #000080;">          ruleflow-group "validate"</span></p><p><span style="color: #000080;">    when               </span></p><p><span style="color: #000080;">    then</span></p><p><span style="color: #000080;">         System.out.println( "TEST RULE ^^^" );</span></p><p><span style="color: #000080;">end</span></p><p><span style="color: #000080;"><span style="color: #000000;">=============================================================</span><br/></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="color: #000000;">and process content is as following.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="color: #000000;">========================================================================================================</span></p><p><span style="color: #0000ff;"><?xml version="1.0" encoding="UTF-8"?> </span></p><p><span style="color: #0000ff;"><definitions id="Definition"</span></p><p><span style="color: #0000ff;"><span>             targetNamespace="</span><a class="jive-link-external-small" href="http://www.jboss.org/drools" target="_blank">http://www.jboss.org/drools</a><span>"</span></span></p><p><span style="color: #0000ff;"><span>             typeLanguage="</span><a class="jive-link-external-small" href="http://www.java.com/javaTypes" target="_blank">http://www.java.com/javaTypes</a><span>"</span></span></p><p><span style="color: #0000ff;"><span>             expressionLanguage="</span><a class="jive-link-external-small" href="http://www.mvel.org/2.0" target="_blank">http://www.mvel.org/2.0</a><span>"</span></span></p><p><span style="color: #0000ff;"><span>             xmlns="</span><a class="jive-link-external-small" href="http://www.omg.org/spec/BPMN/20100524/MODEL" target="_blank">http://www.omg.org/spec/BPMN/20100524/MODEL</a><span>"</span></span></p><p><span style="color: #0000ff;"><span>             xmlns:xsi="</span><a class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a><span>"</span></span></p><p><span style="color: #0000ff;"><span>             xsi:schemaLocation="</span><a class="jive-link-external-small" href="http://www.omg.org/spec/BPMN/20100524/MODEL" target="_blank">http://www.omg.org/spec/BPMN/20100524/MODEL</a><span> BPMN20.xsd"</span></span></p><p><span style="color: #0000ff;"><span>             xmlns:g="</span><a class="jive-link-external-small" href="http://www.jboss.org/drools/flow/gpd" target="_blank">http://www.jboss.org/drools/flow/gpd</a><span>"</span></span></p><p><span style="color: #0000ff;"><span>             xmlns:bpmndi="</span><a class="jive-link-external-small" href="http://www.omg.org/spec/BPMN/20100524/DI" target="_blank">http://www.omg.org/spec/BPMN/20100524/DI</a><span>"</span></span></p><p><span style="color: #0000ff;"><span>             xmlns:dc="</span><a class="jive-link-external-small" href="http://www.omg.org/spec/DD/20100524/DC" target="_blank">http://www.omg.org/spec/DD/20100524/DC</a><span>"</span></span></p><p><span style="color: #0000ff;"><span>             xmlns:di="</span><a class="jive-link-external-small" href="http://www.omg.org/spec/DD/20100524/DI" target="_blank">http://www.omg.org/spec/DD/20100524/DI</a><span>"</span></span></p><p><span style="color: #0000ff;"><span>             xmlns:tns="</span><a class="jive-link-external-small" href="http://www.jboss.org/drools" target="_blank">http://www.jboss.org/drools</a><span>"> </span></span></p><p><span style="color: #0000ff;">  <process processType="Private" isExecutable="true" id="testrule" name="TestRule" tns:packageName="defaultPackage" > </span></p><p><span style="color: #0000ff;">    <!-- nodes --></span></p><p><span style="color: #0000ff;">    <startEvent id="_1" name="StartProcess" /></span></p><p><span style="color: #0000ff;"><span>    <scriptTask id="_2" name="Script" scriptFormat="</span><a class="jive-link-external-small" href="http://www.java.com/java" target="_blank">http://www.java.com/java</a><span>" ></span></span></p><p><span style="color: #0000ff;">      <script>System.out.println("Before rule\n");</span></p><p><span style="color: #0000ff;">                    org.drools.runtime.StatefulKnowledgeSession ksession = </span></p><p><span style="color: #0000ff;">                         (org.drools.runtime.StatefulKnowledgeSession)</span></p><p><span style="color: #0000ff;">                          kcontext.getKnowledgeRuntime();</span></p><p><span style="color: #0000ff;">        ksession.fireAllRules();</span></p><p><span style="color: #0000ff;">System.out.println("After rule\n");</script></span></p><p><span style="color: #0000ff;">    </scriptTask></span></p><p><span style="color: #0000ff;">    <businessRuleTask id="_3" name="Rule" g:ruleFlowGroup="validate" ></span></p><p><span style="color: #0000ff;">    </businessRuleTask></span></p><p><span style="color: #0000ff;">    <endEvent id="_4" name="End" ></span></p><p><span style="color: #0000ff;">        <terminateEventDefinition/></span></p><p><span style="color: #0000ff;">    </endEvent></span></p><p><span style="color: #0000ff;"><span>    <scriptTask id="_5" name="Script" scriptFormat="</span><a class="jive-link-external-small" href="http://www.java.com/java" target="_blank">http://www.java.com/java</a><span>" ></span></span></p><p><span style="color: #0000ff;">      <script>System.out.println("DONE");</script></span></p><p><span style="color: #0000ff;">    </scriptTask></span></p><p><span style="color: #0000ff;">    <!-- connections --></span></p><p><span style="color: #0000ff;">    <sequenceFlow id="_1-_2" sourceRef="_1" targetRef="_2" /></span></p><p><span style="color: #0000ff;">    <sequenceFlow id="_2-_3" sourceRef="_2" targetRef="_3" /></span></p><p><span style="color: #0000ff;">    <sequenceFlow id="_5-_4" sourceRef="_5" targetRef="_4" /></span></p><p><span style="color: #0000ff;">    <sequenceFlow id="_3-_5" sourceRef="_3" targetRef="_5" /> </span></p><p><span style="color: #0000ff;">  </process> </span></p><p><span style="color: #0000ff;">  <bpmndi:BPMNDiagram></span></p><p><span style="color: #0000ff;">    <bpmndi:BPMNPlane bpmnElement="testrule" ></span></p><p><span style="color: #0000ff;">      <bpmndi:BPMNShape bpmnElement="_1" ></span></p><p><span style="color: #0000ff;">        <dc:Bounds x="16" y="16" width="48" height="48" /></span></p><p><span style="color: #0000ff;">      </bpmndi:BPMNShape></span></p><p><span style="color: #0000ff;">      <bpmndi:BPMNShape bpmnElement="_2" ></span></p><p><span style="color: #0000ff;">        <dc:Bounds x="96" y="16" width="80" height="48" /></span></p><p><span style="color: #0000ff;">      </bpmndi:BPMNShape></span></p><p><span style="color: #0000ff;">      <bpmndi:BPMNShape bpmnElement="_3" ></span></p><p><span style="color: #0000ff;">        <dc:Bounds x="208" y="16" width="80" height="48" /></span></p><p><span style="color: #0000ff;">      </bpmndi:BPMNShape></span></p><p><span style="color: #0000ff;">      <bpmndi:BPMNShape bpmnElement="_4" ></span></p><p><span style="color: #0000ff;">        <dc:Bounds x="432" y="16" width="48" height="48" /></span></p><p><span style="color: #0000ff;">      </bpmndi:BPMNShape></span></p><p><span style="color: #0000ff;">      <bpmndi:BPMNShape bpmnElement="_5" ></span></p><p><span style="color: #0000ff;">        <dc:Bounds x="320" y="16" width="80" height="48" /></span></p><p><span style="color: #0000ff;">      </bpmndi:BPMNShape></span></p><p><span style="color: #0000ff;">      <bpmndi:BPMNEdge bpmnElement="_1-_2" ></span></p><p><span style="color: #0000ff;">        <di:waypoint x="40" y="40" /></span></p><p><span style="color: #0000ff;">        <di:waypoint x="136" y="40" /></span></p><p><span style="color: #0000ff;">      </bpmndi:BPMNEdge></span></p><p><span style="color: #0000ff;">      <bpmndi:BPMNEdge bpmnElement="_2-_3" ></span></p><p><span style="color: #0000ff;">        <di:waypoint x="136" y="40" /></span></p><p><span style="color: #0000ff;">        <di:waypoint x="248" y="40" /></span></p><p><span style="color: #0000ff;">      </bpmndi:BPMNEdge></span></p><p><span style="color: #0000ff;">      <bpmndi:BPMNEdge bpmnElement="_5-_4" ></span></p><p><span style="color: #0000ff;">        <di:waypoint x="360" y="40" /></span></p><p><span style="color: #0000ff;">        <di:waypoint x="456" y="40" /></span></p><p><span style="color: #0000ff;">      </bpmndi:BPMNEdge></span></p><p><span style="color: #0000ff;">      <bpmndi:BPMNEdge bpmnElement="_3-_5" ></span></p><p><span style="color: #0000ff;">        <di:waypoint x="248" y="40" /></span></p><p><span style="color: #0000ff;">        <di:waypoint x="360" y="40" /></span></p><p><span style="color: #0000ff;">      </bpmndi:BPMNEdge></span></p><p><span style="color: #0000ff;">    </bpmndi:BPMNPlane></span></p><p><span style="color: #0000ff;">  </bpmndi:BPMNDiagram> </span></p><p><span style="color: #0000ff;"></definitions></span></p><p><span style="color: #000000;"><br/></span></p><p><span style="color: #000000;">========================================================================================================</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="color: #000000;">in the first script task.</span></p><p><span style="color: #000000;">I have a code snippet to call fireAllRules in order to trigger rule task to work.</span></p><p><span style="color: #000000;">==================================================================</span></p><p><span style="color: #000080;">System.out.println("Before rule\n");</span></p><p><span style="color: #000080;">                    org.drools.runtime.StatefulKnowledgeSession ksession = </span></p><p><span style="color: #000080;">                         (org.drools.runtime.StatefulKnowledgeSession)</span></p><p><span style="color: #000080;">                          kcontext.getKnowledgeRuntime();</span></p><p><span style="color: #000080;">        ksession.fireAllRules();</span></p><p><span style="color: #000080;">System.out.println("After rule\n");</span></p><p><span style="color: #000000;"><br/></span></p><p><span style="color: #000000;">===================================================================</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="color: #000000;">and then I deployed all these artifacts to Guvnor repository by using Gnvnor plugin in eclipse.</span></p><p><span style="color: #000000;"><span>the I open a browser to </span><a class="jive-link-external-small" href="http://localhost:8080/jbpm-console" target="_blank">http://localhost:8080/jbpm-console</a><span> to start a process.</span></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="color: #000000;">i have been trying many ways to try to fire a rule task to work.</span></p><p><span style="color: #000000;">however, </span></p><p><span style="color: #000000;">It always stops at rule task and can not mve to next script task.</span></p><p><span style="color: #000000;">I don't know why it goes this way.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="color: #000000;"><a href="http://community.jboss.org/servlet/JiveServlet/showImage/2-631470-17156/Screenshot.png"><span> http://community.jboss.org/servlet/JiveServlet/downloadImage/2-631470-17156/450-88/Screenshot.png </span></a></span></p><p><span style="color: #000000;">log file is attached.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="color: #000000;">any suggest and help will be appreciated.</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span style="color: #000000;">Guo-Guang<br/></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/631470#631470">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>