<!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;">
    Running a script task and then a rule in a process
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="https://community.jboss.org/people/veerala_in">Ramesh Verala</a> in <i>jBPM</i> - <a href="https://community.jboss.org/message/760688#760688">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>Newbie to BPM/BRMS. I am trying to run a rule after a script task in jBPM 5.3. I am trying to do everything through the jbpm web console, except for the flow group designing, since there is no provision, to my knowledge to design the&#160; rule flow in jBPM console. I tried calling fireAllRules() through ksession in the script. I also tried to call fireAllRules() through listener as suggested in another thread here. Never the less I am unable to do it. I must be doing some fundamental mistake here, can anyone suggest me.</p><p>Here are the sources:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="text-decoration: underline;"><strong style="font-size: 12pt;">Model and Rule:</strong></span></p><p>--------------------------------</p><table><tbody><tr><td style=";"><span style="color: grey;">1.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">package</span> salesOrder</td></tr><tr><td style=";"><span style="color: grey;">2.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">declare</span> Employee</td></tr><tr><td style=";"><span style="color: grey;">3.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; name: String</td></tr><tr><td style=";"><span style="color: grey;">4.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; id: Integer</td></tr><tr><td style=";"><span style="color: grey;">5.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; email: String</td></tr><tr><td style=";"><span style="color: grey;">6.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; mobile: Integer</td></tr><tr><td style=";"><span style="color: grey;">7.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">end</span></td></tr><tr><td style=";"><span style="color: grey;">8.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><br/></td></tr><tr><td style=";"><span style="color: grey;">9.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">declare</span> Customer</td></tr><tr><td style=";"><span style="color: grey;">10.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; name: String</td></tr><tr><td style=";"><span style="color: grey;">11.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; email: String</td></tr><tr><td style=";"><span style="color: grey;">12.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; mobile: Integer</td></tr><tr><td style=";"><span style="color: grey;">13.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; isRegistered: Boolean</td></tr><tr><td style=";"><span style="color: grey;">14.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; address: String</td></tr><tr><td style=";"><span style="color: grey;">15.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">end</span></td></tr><tr><td style=";"><span style="color: grey;">16.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><br/></td></tr><tr><td style=";"><span style="color: grey;">17.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">declare</span> Product</td></tr><tr><td style=";"><span style="color: grey;">18.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; name: String</td></tr><tr><td style=";"><span style="color: grey;">19.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; price: Integer</td></tr><tr><td style=";"><span style="color: grey;">20.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">end</span></td></tr><tr><td style=";"><span style="color: grey;">21.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><br/></td></tr><tr><td style=";"><span style="color: grey;">22.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">declare</span> Company</td></tr><tr><td style=";"><span style="color: grey;">23.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; name: String</td></tr><tr><td style=";"><span style="color: grey;">24.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; products: Product</td></tr><tr><td style=";"><span style="color: grey;">25.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; warehouse: String</td></tr><tr><td style=";"><span style="color: grey;">26.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">end</span></td></tr><tr><td style=";"><span style="color: grey;">27.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><br/></td></tr><tr><td style=";"><span style="color: grey;">28.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">declare</span> Order</td></tr><tr><td style=";"><span style="color: grey;">29.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; customer: Customer</td></tr><tr><td style=";"><span style="color: grey;">30.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; product: Product</td></tr><tr><td style=";"><span style="color: grey;">31.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; totalPrice: Integer</td></tr><tr><td style=";"><span style="color: grey;">32.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; isDiscountAllowed: Boolean</td></tr><tr><td style=";"><span style="color: grey;">33.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; discountPercent: Integer</td></tr><tr><td style=";"><span style="color: grey;">34.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; discountAmount: Integer</td></tr><tr><td style=";"><span style="color: grey;">35.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; invoicePrice: Integer</td></tr><tr><td style=";"><span style="color: grey;">36.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; isMoneyPaid: Boolean</td></tr><tr><td style=";"><span style="color: grey;">37.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">end</span></td></tr><tr><td style=";"><span style="color: grey;">38.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><br/></td></tr><tr><td style=";"><span style="color: grey;">39.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">declare</span> Shipment</td></tr><tr><td style=";"><span style="color: grey;">40.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; Order: Order</td></tr><tr><td style=";"><span style="color: grey;">41.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; dateShipped: java.util.Date</td></tr><tr><td style=";"><span style="color: grey;">42.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; toBeShipped: Boolean</td></tr><tr><td style=";"><span style="color: grey;">43.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; shipped: Boolean</td></tr><tr><td style=";"><span style="color: grey;">44.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">end</span></td></tr><tr><td style=";"><span style="color: grey;">45.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><br/></td></tr><tr><td style=";"><span style="color: grey;">46.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">declare</span> CustomerServiceRep ext<span style="color: red;">end</span>s Employee</td></tr><tr><td style=";"><span style="color: grey;">47.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; order: Order</td></tr><tr><td style=";"><span style="color: grey;">48.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">end</span></td></tr><tr><td style=";"><span style="color: grey;">49.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><br/></td></tr><tr><td style=";"><span style="color: grey;">50.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">declare</span> Accountant ext<span style="color: red;">end</span>s Employee</td></tr><tr><td style=";"><span style="color: grey;">51.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; order: Order</td></tr><tr><td style=";"><span style="color: grey;">52.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">end</span></td></tr><tr><td style=";"><span style="color: grey;">53.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><br/></td></tr><tr><td style=";"><span style="color: grey;">54.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">declare</span> WareHouseRep ext<span style="color: red;">end</span>s Employee</td></tr><tr><td style=";"><span style="color: grey;">55.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; shipment: Shipment</td></tr><tr><td style=";"><span style="color: grey;">56.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">end</span></td></tr><tr><td style=";"><span style="color: grey;">57.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><br/></td></tr><tr><td style=";"><span style="color: grey;">58.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><br/></td></tr><tr><td style=";"><span style="color: grey;">59.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><br/></td></tr><tr><td style=";"><span style="color: grey;">60.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">rule</span> <span style="color: green;">"CreditApproved"</span></td></tr><tr><td style=";"><span style="color: grey;">61.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; <span style="color: red;">dialect</span> <span style="color: green;">"java"</span></td></tr><tr><td style=";"><span style="color: grey;">62.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; <span style="color: red;">rule</span>flow-group <span style="color: green;">"SalesOrderRuleFlowId"</span></td></tr><tr><td style=";"><span style="color: grey;">63.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; <span style="color: red;">when</span></td></tr><tr><td style=";"><span style="color: grey;">64.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; Customer( isRegistered == true )</td></tr><tr><td style=";"><span style="color: grey;">65.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; <span style="color: red;">then</span></td></tr><tr><td style=";"><span style="color: grey;">66.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.print(<span style="color: green;">"Credit Approved Rule Applied"</span>);</td></tr><tr><td style=";"><span style="color: grey;">67.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span style="color: red;">end</span></td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="text-decoration: underline;"><strong style="font-size: 12pt;">Rules Flow Source:</strong></span></p><p>---------------------------------------------------------------------------------</p><p>&lt;?xml version="1.0" encoding="UTF-8"?&gt; </p><p><span>&lt;process xmlns="</span><a class="jive-link-external-small" href="http://drools.org/drools-5.0/process" target="_blank">http://drools.org/drools-5.0/process</a><span>"</span></p><p><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xmlns:xs="</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></p><p><span>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; xs:schemaLocation="</span><a class="jive-link-external-small" href="http://drools.org/drools-5.0/process" target="_blank">http://drools.org/drools-5.0/process</a><span> drools-processes-5.0.xsd"</span></p><p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; type="RuleFlow" name="SalesOrderRuleFlowName" id="SalesOrderRuleFlowId" package-name="salesOrder" &gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; &lt;header&gt;</p><p>&#160; &lt;/header&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; &lt;nodes&gt;</p><p>&#160;&#160;&#160; &lt;start id="1" name="Start" x="16" y="26" width="48" height="48" /&gt;</p><p>&#160;&#160;&#160; &lt;ruleSet id="3" name="CreditApproved" x="96" y="17" width="116" height="67" ruleFlowGroup="SalesOrderRuleFlowId" /&gt;</p><p>&#160;&#160;&#160; &lt;end id="6" name="End" x="392" y="26" width="48" height="48" /&gt;</p><p>&#160; &lt;/nodes&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160; &lt;connections&gt;</p><p>&#160;&#160;&#160; &lt;connection from="1" to="3" /&gt;</p><p>&#160;&#160;&#160; &lt;connection from="3" to="6" /&gt;</p><p>&#160; &lt;/connections&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;/process&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>---------------------------------------</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="text-decoration: underline; font-size: 12pt;"><strong>Process Source:</strong></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><table><tbody><tr><td style=";"><span style="color: grey;">1.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&lt;?xml version="1.0" encoding="UTF-8"?&gt; </td></tr><tr><td style=";"><span style="color: grey;">2.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&lt;bpmn2:def<span style="color: red;">init</span><span>ions 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>" xmlns="</span><a class="jive-link-external-small" href="http://www.omg.org/bpmn20" target="_blank">http://www.omg.org/bpmn20</a><span>" xmlns:bpmn2="</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>" 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>" 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>" 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>" xmlns:drools="</span><a class="jive-link-external-small" href="http://www.jboss.org/drools" target="_blank">http://www.jboss.org/drools</a><span>" id="_ptfzEANVEeK2lJvWBPLVRg" 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" targetNamespace="</span><a class="jive-link-external-small" href="http://www.omg.org/bpmn20" target="_blank">http://www.omg.org/bpmn20</a><span>"&gt; </span></td></tr><tr><td style=";"><span style="color: grey;">3.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160; &lt;bpmn2:process id="salesOrder.SalesOrderProcess" drools:<span style="color: red;">package</span>Name="salesOrder" name="SalesOrderProcess" isExecutable="true"&gt; </td></tr><tr><td style=";"><span style="color: grey;">4.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; &lt;bpmn2:startEvent id="_104129D7-29A0-49E8-A790-226F714A41CD" drools:bgcolor="#9acd32" name=""&gt; </td></tr><tr><td style=";"><span style="color: grey;">5.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:outgoing&gt;_824C0C53-4A42-4D52-9114-B033A8CAFC81&lt;/bpmn2:outgoing&gt; </td></tr><tr><td style=";"><span style="color: grey;">6.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; &lt;/bpmn2:startEvent&gt; </td></tr><tr><td style=";"><span style="color: grey;">7.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span> &lt;bpmn2:scriptTask id="_60A5093D-5DE3-4077-8F5F-AF569A60B626" drools:bgcolor="#fafad2" drools:taskName="PlaceOrder" name="PlaceOrder" scriptFormat="</span><a class="jive-link-external-small" href="http://www.java.com/java" target="_blank">http://www.java.com/java</a><span>"&gt; </span></td></tr><tr><td style=";"><span style="color: grey;">8.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:incoming&gt;_824C0C53-4A42-4D52-9114-B033A8CAFC81&lt;/bpmn2:incoming&gt; </td></tr><tr><td style=";"><span style="color: grey;">9.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:outgoing&gt;_8A2D3B8A-B1F9-4993-B112-84458270EFAF&lt;/bpmn2:outgoing&gt; </td></tr><tr><td style=";"><span style="color: grey;">10.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:ioSpecification id="_ptfzEQNVEeK2lJvWBPLVRg"&gt; </td></tr><tr><td style=";"><span style="color: grey;">11.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:dataInput id="_60A5093D-5DE3-4077-8F5F-AF569A60B626_TaskNameInput" name="TaskName"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">12.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:inputSet id="_ptgaIANVEeK2lJvWBPLVRg"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">13.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:outputSet id="_ptgaIQNVEeK2lJvWBPLVRg"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">14.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;/bpmn2:ioSpecification&gt; </td></tr><tr><td style=";"><span style="color: grey;">15.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:dataInputAssociation id="_ptgaIgNVEeK2lJvWBPLVRg"&gt; </td></tr><tr><td style=";"><span style="color: grey;">16.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:targetRef&gt;_60A5093D-5DE3-4077-8F5F-AF569A60B626_TaskNameInput&lt;/bpmn2:targetRef&gt; </td></tr><tr><td style=";"><span style="color: grey;">17.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:assignment id="_ptgaIwNVEeK2lJvWBPLVRg"&gt; </td></tr><tr><td style=";"><span style="color: grey;">18.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:<span style="color: red;">from</span> xsi:type="bpmn2:tFormalExpression" id="_ptgaJANVEeK2lJvWBPLVRg"&gt;PlaceOrder&lt;/bpmn2:<span style="color: red;">from</span>&gt; </td></tr><tr><td style=";"><span style="color: grey;">19.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"> &lt;bpmn2:to xsi:type="bpmn2:tFormalExpression" id="_ptgaJQNVEeK2lJvWBPLVRg"&gt;_60A5093D-5DE3-4077-8F5F-AF569A60B626_TaskNameInput&lt;/bpmn2:to&gt; </td></tr><tr><td style=";"><span style="color: grey;">20.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/bpmn2:assignment&gt; </td></tr><tr><td style=";"><span style="color: grey;">21.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;/bpmn2:dataInputAssociation&gt; </td></tr><tr><td style=";"><span style="color: grey;">22.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><p> &lt;bpmn2:script&gt;&lt;![CDATA[System.out.println("Hello Ramesh"); </p><p>Customer c = new Customer(); </p><p>c.setName("Ramesh Verala"); c.setIsRegistered(true); </p><p>Product p = new Product();p.setName("apparel");</p><p>Order o = new Order();</p><p>o.setProduct(p);</p><p>o.setCustomer(c);</p><p>o.setIsMoneyPaid(false);</p><p>org.drools.event.Ag<span style="color: red;">end</span>aEventListener lis = new org.drools.event.Ag<span style="color: red;">end</span>aEventListener(){ </p><p>public void activationCancelled(org.drools.event.ActivationCancelledEvent arg0, org.drools.WorkingMemory arg1) { } </p><p> public void activationCreated(org.drools.event.ActivationCreatedEvent arg0, org.drools.WorkingMemory arg1) { }</p><p> public void afterActivationFired( org.drools.event.AfterActivationFiredEvent arg0, org.drools.WorkingMemory arg1) { } </p><p>public void afterRuleFlowGroupActivated( org.drools.event.RuleFlowGroupActivatedEvent arg0, org.drools.WorkingMemory arg1) </p><p> { System.out.println("firing all <span style="color: red;">rule</span>s"); arg1.fireAllRules(); }</p><p> public void afterRuleFlowGroupDeactivated( org.drools.event.RuleFlowGroupDeactivatedEvent arg0, org.drools.WorkingMemory arg1) { } </p><p>public void ag<span style="color: red;">end</span>aGroupPopped(org.drools.event.Ag<span style="color: red;">end</span>aGroupPoppedEvent arg0, org.drools.WorkingMemory arg1) { }</p><p> public void ag<span style="color: red;">end</span>aGroupPushed(org.drools.event.Ag<span style="color: red;">end</span>aGroupPushedEvent arg0, org.drools.WorkingMemory arg1) { } </p><p>public void beforeActivationFired( org.drools.event.BeforeActivationFiredEvent arg0, org.drools.WorkingMemory arg1) { } </p><p>public void beforeRuleFlowGroupActivated( org.drools.event.RuleFlowGroupActivatedEvent arg0, org.drools.WorkingMemory arg1) { } </p><p> public void beforeRuleFlowGroupDeactivated( org.drools.event.RuleFlowGroupDeactivatedEvent arg0, org.drools.WorkingMemory arg1) { }&#160; }; </p><p> System.out.println("casting.."); </p><p>org.drools.runtime.StatefulKnowledgeSession ksession = (org.drools.runtime.StatefulKnowledgeSession) kcontext.getKnowledgeRuntime(); </p><p>try{ </p><p>org.drools.impl.StatefulKnowledgeSessionImpl s = (org.drools.impl.StatefulKnowledgeSessionImpl)ksession; s.session.addEventListener(lis)&#160; ; </p><p>System.out.println("listener is added"); } catch(Exception ex) { System.out.println("================================================================================================================"); </p><p>System.out.println(ex.getMessage()); }</p><p>ksession.insert(c);ksession.insert(o);]]&gt;&lt;/bpmn2:script&gt; </p></td></tr><tr><td style=";"><span style="color: grey;">23.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; &lt;/bpmn2:scriptTask&gt; </td></tr><tr><td style=";"><span style="color: grey;">24.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"> &lt;bpmn2:businessRuleTask id="_0172EE3A-F4D5-4FBE-B796-F703A4877671" drools:bgcolor="#fafad2" drools:taskName="CreditApproved" drools:<span style="color: red;">rule</span>FlowGroup="salesOrder.SalesOrderRuleFlowId" name="CreditApproved"&gt; </td></tr><tr><td style=";"><span style="color: grey;">25.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:incoming&gt;_8A2D3B8A-B1F9-4993-B112-84458270EFAF&lt;/bpmn2:incoming&gt; </td></tr><tr><td style=";"><span style="color: grey;">26.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:outgoing&gt;_70594D97-F29D-4D84-B0DC-86312DFCB533&lt;/bpmn2:outgoing&gt; </td></tr><tr><td style=";"><span style="color: grey;">27.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:ioSpecification id="_ptgaJgNVEeK2lJvWBPLVRg"&gt; </td></tr><tr><td style=";"><span style="color: grey;">28.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:dataInput id="_0172EE3A-F4D5-4FBE-B796-F703A4877671_TaskNameInput" name="TaskName"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">29.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:inputSet id="_ptgaJwNVEeK2lJvWBPLVRg"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">30.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:outputSet id="_ptgaKANVEeK2lJvWBPLVRg"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">31.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;/bpmn2:ioSpecification&gt; </td></tr><tr><td style=";"><span style="color: grey;">32.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:dataInputAssociation id="_ptgaKQNVEeK2lJvWBPLVRg"&gt; </td></tr><tr><td style=";"><span style="color: grey;">33.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:targetRef&gt;_0172EE3A-F4D5-4FBE-B796-F703A4877671_TaskNameInput&lt;/bpmn2:targetRef&gt; </td></tr><tr><td style=";"><span style="color: grey;">34.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:assignment id="_ptgaKgNVEeK2lJvWBPLVRg"&gt; </td></tr><tr><td style=";"><span style="color: grey;">35.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:<span style="color: red;">from</span> xsi:type="bpmn2:tFormalExpression" id="_ptgaKwNVEeK2lJvWBPLVRg"&gt;CreditApproved&lt;/bpmn2:<span style="color: red;">from</span>&gt; </td></tr><tr><td style=";"><span style="color: grey;">36.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"> &lt;bpmn2:to xsi:type="bpmn2:tFormalExpression" id="_ptgaLANVEeK2lJvWBPLVRg"&gt;_0172EE3A-F4D5-4FBE-B796-F703A4877671_TaskNameInput&lt;/bpmn2:to&gt; </td></tr><tr><td style=";"><span style="color: grey;">37.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/bpmn2:assignment&gt; </td></tr><tr><td style=";"><span style="color: grey;">38.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;/bpmn2:dataInputAssociation&gt; </td></tr><tr><td style=";"><span style="color: grey;">39.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; &lt;/bpmn2:businessRuleTask&gt; </td></tr><tr><td style=";"><span style="color: grey;">40.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; &lt;bpmn2:<span style="color: red;">end</span>Event id="_AD849530-E5B2-4953-AA9B-2B5F7FB8C3D6" drools:bgcolor="#ff6347" name=""&gt; </td></tr><tr><td style=";"><span style="color: grey;">41.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;bpmn2:incoming&gt;_70594D97-F29D-4D84-B0DC-86312DFCB533&lt;/bpmn2:incoming&gt; </td></tr><tr><td style=";"><span style="color: grey;">42.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; &lt;/bpmn2:<span style="color: red;">end</span>Event&gt; </td></tr><tr><td style=";"><span style="color: grey;">43.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"> &lt;bpmn2:sequenceFlow id="_824C0C53-4A42-4D52-9114-B033A8CAFC81" sourceRef="_104129D7-29A0-49E8-A790-226F714A41CD" targetRef="_60A5093D-5DE3-4077-8F5F-AF569A60B626"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">44.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"> &lt;bpmn2:sequenceFlow id="_8A2D3B8A-B1F9-4993-B112-84458270EFAF" sourceRef="_60A5093D-5DE3-4077-8F5F-AF569A60B626" targetRef="_0172EE3A-F4D5-4FBE-B796-F703A4877671"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">45.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"> &lt;bpmn2:sequenceFlow id="_70594D97-F29D-4D84-B0DC-86312DFCB533" sourceRef="_0172EE3A-F4D5-4FBE-B796-F703A4877671" targetRef="_AD849530-E5B2-4953-AA9B-2B5F7FB8C3D6"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">46.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160; &lt;/bpmn2:process&gt; </td></tr><tr><td style=";"><span style="color: grey;">47.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160; &lt;bpmndi:BPMNDiagram id="_ptgaLQNVEeK2lJvWBPLVRg"&gt; </td></tr><tr><td style=";"><span style="color: grey;">48.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; &lt;bpmndi:BPMNPlane id="_ptgaLgNVEeK2lJvWBPLVRg" bpmnElement="salesOrder.SalesOrderProcess"&gt; </td></tr><tr><td style=";"><span style="color: grey;">49.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;bpmndi:BPMNShape id="_ptgaLwNVEeK2lJvWBPLVRg" bpmnElement="_104129D7-29A0-49E8-A790-226F714A41CD"&gt; </td></tr><tr><td style=";"><span style="color: grey;">50.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dc:Bounds height="30.0" width="30.0" x="75.0" y="115.0"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">51.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;/bpmndi:BPMNShape&gt; </td></tr><tr><td style=";"><span style="color: grey;">52.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;bpmndi:BPMNShape id="_ptgaMANVEeK2lJvWBPLVRg" bpmnElement="_60A5093D-5DE3-4077-8F5F-AF569A60B626"&gt; </td></tr><tr><td style=";"><span style="color: grey;">53.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dc:Bounds height="80.0" width="100.0" x="165.0" y="75.0"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">54.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;/bpmndi:BPMNShape&gt; </td></tr><tr><td style=";"><span style="color: grey;">55.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;bpmndi:BPMNShape id="_ptgaMQNVEeK2lJvWBPLVRg" bpmnElement="_0172EE3A-F4D5-4FBE-B796-F703A4877671"&gt; </td></tr><tr><td style=";"><span style="color: grey;">56.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dc:Bounds height="80.0" width="100.0" x="345.0" y="90.0"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">57.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;/bpmndi:BPMNShape&gt; </td></tr><tr><td style=";"><span style="color: grey;">58.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;bpmndi:BPMNShape id="_ptgaMgNVEeK2lJvWBPLVRg" bpmnElement="_AD849530-E5B2-4953-AA9B-2B5F7FB8C3D6"&gt; </td></tr><tr><td style=";"><span style="color: grey;">59.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;dc:Bounds height="28.0" width="28.0" x="789.0" y="95.0"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">60.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;/bpmndi:BPMNShape&gt; </td></tr><tr><td style=";"><span style="color: grey;">61.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;bpmndi:BPMNEdge id="_ptgaMwNVEeK2lJvWBPLVRg" bpmnElement="_824C0C53-4A42-4D52-9114-B033A8CAFC81"&gt; </td></tr><tr><td style=";"><span style="color: grey;">62.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint xsi:type="dc:Point" x="90.0" y="130.0"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">63.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint xsi:type="dc:Point" x="135.0" y="130.0"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">64.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint xsi:type="dc:Point" x="135.0" y="115.0"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">65.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint xsi:type="dc:Point" x="215.0" y="115.0"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">66.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;/bpmndi:BPMNEdge&gt; </td></tr><tr><td style=";"><span style="color: grey;">67.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;bpmndi:BPMNEdge id="_ptgaNANVEeK2lJvWBPLVRg" bpmnElement="_8A2D3B8A-B1F9-4993-B112-84458270EFAF"&gt; </td></tr><tr><td style=";"><span style="color: grey;">68.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint xsi:type="dc:Point" x="215.0" y="115.0"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">69.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint xsi:type="dc:Point" x="305.0" y="115.0"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">70.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint xsi:type="dc:Point" x="305.0" y="130.0"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">71.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint xsi:type="dc:Point" x="395.0" y="130.0"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">72.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;/bpmndi:BPMNEdge&gt; </td></tr><tr><td style=";"><span style="color: grey;">73.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;bpmndi:BPMNEdge id="_ptgaNQNVEeK2lJvWBPLVRg" bpmnElement="_70594D97-F29D-4D84-B0DC-86312DFCB533"&gt; </td></tr><tr><td style=";"><span style="color: grey;">74.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint xsi:type="dc:Point" x="395.0" y="130.0"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">75.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint xsi:type="dc:Point" x="618.0" y="130.0"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">76.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint xsi:type="dc:Point" x="618.0" y="111.0"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">77.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;di:waypoint xsi:type="dc:Point" x="803.0" y="109.0"/&gt; </td></tr><tr><td style=";"><span style="color: grey;">78.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160;&#160;&#160; &lt;/bpmndi:BPMNEdge&gt; </td></tr><tr><td style=";"><span style="color: grey;">79.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160;&#160;&#160; &lt;/bpmndi:BPMNPlane&gt; </td></tr><tr><td style=";"><span style="color: grey;">80.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&#160; &lt;/bpmndi:BPMNDiagram&gt; </td></tr><tr><td style=";"><span style="color: grey;">81.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">&lt;/bpmn2:def<span style="color: red;">init</span>ions&gt; </td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thanks</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/760688#760688">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>