<!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  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;"> </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=";">    name: String</td></tr><tr><td style=";"><span style="color: grey;">4.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    id: Integer</td></tr><tr><td style=";"><span style="color: grey;">5.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    email: String</td></tr><tr><td style=";"><span style="color: grey;">6.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    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=";">    name: String</td></tr><tr><td style=";"><span style="color: grey;">11.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    email: String</td></tr><tr><td style=";"><span style="color: grey;">12.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    mobile: Integer</td></tr><tr><td style=";"><span style="color: grey;">13.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    isRegistered: Boolean</td></tr><tr><td style=";"><span style="color: grey;">14.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    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=";">    name: String</td></tr><tr><td style=";"><span style="color: grey;">19.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    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=";">    name: String</td></tr><tr><td style=";"><span style="color: grey;">24.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    products: Product</td></tr><tr><td style=";"><span style="color: grey;">25.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    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=";">    customer: Customer</td></tr><tr><td style=";"><span style="color: grey;">30.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    product: Product</td></tr><tr><td style=";"><span style="color: grey;">31.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    totalPrice: Integer</td></tr><tr><td style=";"><span style="color: grey;">32.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    isDiscountAllowed: Boolean</td></tr><tr><td style=";"><span style="color: grey;">33.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    discountPercent: Integer</td></tr><tr><td style=";"><span style="color: grey;">34.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    discountAmount: Integer</td></tr><tr><td style=";"><span style="color: grey;">35.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    invoicePrice: Integer</td></tr><tr><td style=";"><span style="color: grey;">36.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    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=";">    Order: Order</td></tr><tr><td style=";"><span style="color: grey;">41.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    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=";">    toBeShipped: Boolean</td></tr><tr><td style=";"><span style="color: grey;">43.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    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=";">    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=";">    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=";">    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=";">    <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=";">    <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=";">    <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=";">        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=";">    <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=";">        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;"> </p><p><span style="text-decoration: underline;"><strong style="font-size: 12pt;">Rules Flow Source:</strong></span></p><p>---------------------------------------------------------------------------------</p><p><?xml version="1.0" encoding="UTF-8"?> </p><p><span><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>         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>         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>         type="RuleFlow" name="SalesOrderRuleFlowName" id="SalesOrderRuleFlowId" package-name="salesOrder" ></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  <header></p><p>  </header></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  <nodes></p><p>    <start id="1" name="Start" x="16" y="26" width="48" height="48" /></p><p>    <ruleSet id="3" name="CreditApproved" x="96" y="17" width="116" height="67" ruleFlowGroup="SalesOrderRuleFlowId" /></p><p>    <end id="6" name="End" x="392" y="26" width="48" height="48" /></p><p>  </nodes></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  <connections></p><p>    <connection from="1" to="3" /></p><p>    <connection from="3" to="6" /></p><p>  </connections></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p></process></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>---------------------------------------</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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;"> </p><table><tbody><tr><td style=";"><span style="color: grey;">1.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><?xml version="1.0" encoding="UTF-8"?> </td></tr><tr><td style=";"><span style="color: grey;">2.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><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>"> </span></td></tr><tr><td style=";"><span style="color: grey;">3.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">  <bpmn2:process id="salesOrder.SalesOrderProcess" drools:<span style="color: red;">package</span>Name="salesOrder" name="SalesOrderProcess" isExecutable="true"> </td></tr><tr><td style=";"><span style="color: grey;">4.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    <bpmn2:startEvent id="_104129D7-29A0-49E8-A790-226F714A41CD" drools:bgcolor="#9acd32" name=""> </td></tr><tr><td style=";"><span style="color: grey;">5.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      <bpmn2:outgoing>_824C0C53-4A42-4D52-9114-B033A8CAFC81</bpmn2:outgoing> </td></tr><tr><td style=";"><span style="color: grey;">6.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    </bpmn2:startEvent> </td></tr><tr><td style=";"><span style="color: grey;">7.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><span> <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>"> </span></td></tr><tr><td style=";"><span style="color: grey;">8.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      <bpmn2:incoming>_824C0C53-4A42-4D52-9114-B033A8CAFC81</bpmn2:incoming> </td></tr><tr><td style=";"><span style="color: grey;">9.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      <bpmn2:outgoing>_8A2D3B8A-B1F9-4993-B112-84458270EFAF</bpmn2:outgoing> </td></tr><tr><td style=";"><span style="color: grey;">10.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      <bpmn2:ioSpecification id="_ptfzEQNVEeK2lJvWBPLVRg"> </td></tr><tr><td style=";"><span style="color: grey;">11.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <bpmn2:dataInput id="_60A5093D-5DE3-4077-8F5F-AF569A60B626_TaskNameInput" name="TaskName"/> </td></tr><tr><td style=";"><span style="color: grey;">12.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <bpmn2:inputSet id="_ptgaIANVEeK2lJvWBPLVRg"/> </td></tr><tr><td style=";"><span style="color: grey;">13.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <bpmn2:outputSet id="_ptgaIQNVEeK2lJvWBPLVRg"/> </td></tr><tr><td style=";"><span style="color: grey;">14.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      </bpmn2:ioSpecification> </td></tr><tr><td style=";"><span style="color: grey;">15.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      <bpmn2:dataInputAssociation id="_ptgaIgNVEeK2lJvWBPLVRg"> </td></tr><tr><td style=";"><span style="color: grey;">16.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <bpmn2:targetRef>_60A5093D-5DE3-4077-8F5F-AF569A60B626_TaskNameInput</bpmn2:targetRef> </td></tr><tr><td style=";"><span style="color: grey;">17.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <bpmn2:assignment id="_ptgaIwNVEeK2lJvWBPLVRg"> </td></tr><tr><td style=";"><span style="color: grey;">18.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">          <bpmn2:<span style="color: red;">from</span> xsi:type="bpmn2:tFormalExpression" id="_ptgaJANVEeK2lJvWBPLVRg">PlaceOrder</bpmn2:<span style="color: red;">from</span>> </td></tr><tr><td style=";"><span style="color: grey;">19.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"> <bpmn2:to xsi:type="bpmn2:tFormalExpression" id="_ptgaJQNVEeK2lJvWBPLVRg">_60A5093D-5DE3-4077-8F5F-AF569A60B626_TaskNameInput</bpmn2:to> </td></tr><tr><td style=";"><span style="color: grey;">20.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        </bpmn2:assignment> </td></tr><tr><td style=";"><span style="color: grey;">21.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      </bpmn2:dataInputAssociation> </td></tr><tr><td style=";"><span style="color: grey;">22.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"><p> <bpmn2:script><![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) { }  }; </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)  ; </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);]]></bpmn2:script> </p></td></tr><tr><td style=";"><span style="color: grey;">23.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    </bpmn2:scriptTask> </td></tr><tr><td style=";"><span style="color: grey;">24.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"> <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"> </td></tr><tr><td style=";"><span style="color: grey;">25.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      <bpmn2:incoming>_8A2D3B8A-B1F9-4993-B112-84458270EFAF</bpmn2:incoming> </td></tr><tr><td style=";"><span style="color: grey;">26.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      <bpmn2:outgoing>_70594D97-F29D-4D84-B0DC-86312DFCB533</bpmn2:outgoing> </td></tr><tr><td style=";"><span style="color: grey;">27.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      <bpmn2:ioSpecification id="_ptgaJgNVEeK2lJvWBPLVRg"> </td></tr><tr><td style=";"><span style="color: grey;">28.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <bpmn2:dataInput id="_0172EE3A-F4D5-4FBE-B796-F703A4877671_TaskNameInput" name="TaskName"/> </td></tr><tr><td style=";"><span style="color: grey;">29.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <bpmn2:inputSet id="_ptgaJwNVEeK2lJvWBPLVRg"/> </td></tr><tr><td style=";"><span style="color: grey;">30.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <bpmn2:outputSet id="_ptgaKANVEeK2lJvWBPLVRg"/> </td></tr><tr><td style=";"><span style="color: grey;">31.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      </bpmn2:ioSpecification> </td></tr><tr><td style=";"><span style="color: grey;">32.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      <bpmn2:dataInputAssociation id="_ptgaKQNVEeK2lJvWBPLVRg"> </td></tr><tr><td style=";"><span style="color: grey;">33.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <bpmn2:targetRef>_0172EE3A-F4D5-4FBE-B796-F703A4877671_TaskNameInput</bpmn2:targetRef> </td></tr><tr><td style=";"><span style="color: grey;">34.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <bpmn2:assignment id="_ptgaKgNVEeK2lJvWBPLVRg"> </td></tr><tr><td style=";"><span style="color: grey;">35.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">          <bpmn2:<span style="color: red;">from</span> xsi:type="bpmn2:tFormalExpression" id="_ptgaKwNVEeK2lJvWBPLVRg">CreditApproved</bpmn2:<span style="color: red;">from</span>> </td></tr><tr><td style=";"><span style="color: grey;">36.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"> <bpmn2:to xsi:type="bpmn2:tFormalExpression" id="_ptgaLANVEeK2lJvWBPLVRg">_0172EE3A-F4D5-4FBE-B796-F703A4877671_TaskNameInput</bpmn2:to> </td></tr><tr><td style=";"><span style="color: grey;">37.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        </bpmn2:assignment> </td></tr><tr><td style=";"><span style="color: grey;">38.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      </bpmn2:dataInputAssociation> </td></tr><tr><td style=";"><span style="color: grey;">39.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    </bpmn2:businessRuleTask> </td></tr><tr><td style=";"><span style="color: grey;">40.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    <bpmn2:<span style="color: red;">end</span>Event id="_AD849530-E5B2-4953-AA9B-2B5F7FB8C3D6" drools:bgcolor="#ff6347" name=""> </td></tr><tr><td style=";"><span style="color: grey;">41.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      <bpmn2:incoming>_70594D97-F29D-4D84-B0DC-86312DFCB533</bpmn2:incoming> </td></tr><tr><td style=";"><span style="color: grey;">42.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    </bpmn2:<span style="color: red;">end</span>Event> </td></tr><tr><td style=";"><span style="color: grey;">43.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"> <bpmn2:sequenceFlow id="_824C0C53-4A42-4D52-9114-B033A8CAFC81" sourceRef="_104129D7-29A0-49E8-A790-226F714A41CD" targetRef="_60A5093D-5DE3-4077-8F5F-AF569A60B626"/> </td></tr><tr><td style=";"><span style="color: grey;">44.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"> <bpmn2:sequenceFlow id="_8A2D3B8A-B1F9-4993-B112-84458270EFAF" sourceRef="_60A5093D-5DE3-4077-8F5F-AF569A60B626" targetRef="_0172EE3A-F4D5-4FBE-B796-F703A4877671"/> </td></tr><tr><td style=";"><span style="color: grey;">45.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"> <bpmn2:sequenceFlow id="_70594D97-F29D-4D84-B0DC-86312DFCB533" sourceRef="_0172EE3A-F4D5-4FBE-B796-F703A4877671" targetRef="_AD849530-E5B2-4953-AA9B-2B5F7FB8C3D6"/> </td></tr><tr><td style=";"><span style="color: grey;">46.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">  </bpmn2:process> </td></tr><tr><td style=";"><span style="color: grey;">47.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">  <bpmndi:BPMNDiagram id="_ptgaLQNVEeK2lJvWBPLVRg"> </td></tr><tr><td style=";"><span style="color: grey;">48.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    <bpmndi:BPMNPlane id="_ptgaLgNVEeK2lJvWBPLVRg" bpmnElement="salesOrder.SalesOrderProcess"> </td></tr><tr><td style=";"><span style="color: grey;">49.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      <bpmndi:BPMNShape id="_ptgaLwNVEeK2lJvWBPLVRg" bpmnElement="_104129D7-29A0-49E8-A790-226F714A41CD"> </td></tr><tr><td style=";"><span style="color: grey;">50.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <dc:Bounds height="30.0" width="30.0" x="75.0" y="115.0"/> </td></tr><tr><td style=";"><span style="color: grey;">51.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      </bpmndi:BPMNShape> </td></tr><tr><td style=";"><span style="color: grey;">52.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      <bpmndi:BPMNShape id="_ptgaMANVEeK2lJvWBPLVRg" bpmnElement="_60A5093D-5DE3-4077-8F5F-AF569A60B626"> </td></tr><tr><td style=";"><span style="color: grey;">53.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <dc:Bounds height="80.0" width="100.0" x="165.0" y="75.0"/> </td></tr><tr><td style=";"><span style="color: grey;">54.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      </bpmndi:BPMNShape> </td></tr><tr><td style=";"><span style="color: grey;">55.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      <bpmndi:BPMNShape id="_ptgaMQNVEeK2lJvWBPLVRg" bpmnElement="_0172EE3A-F4D5-4FBE-B796-F703A4877671"> </td></tr><tr><td style=";"><span style="color: grey;">56.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <dc:Bounds height="80.0" width="100.0" x="345.0" y="90.0"/> </td></tr><tr><td style=";"><span style="color: grey;">57.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      </bpmndi:BPMNShape> </td></tr><tr><td style=";"><span style="color: grey;">58.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      <bpmndi:BPMNShape id="_ptgaMgNVEeK2lJvWBPLVRg" bpmnElement="_AD849530-E5B2-4953-AA9B-2B5F7FB8C3D6"> </td></tr><tr><td style=";"><span style="color: grey;">59.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <dc:Bounds height="28.0" width="28.0" x="789.0" y="95.0"/> </td></tr><tr><td style=";"><span style="color: grey;">60.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      </bpmndi:BPMNShape> </td></tr><tr><td style=";"><span style="color: grey;">61.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      <bpmndi:BPMNEdge id="_ptgaMwNVEeK2lJvWBPLVRg" bpmnElement="_824C0C53-4A42-4D52-9114-B033A8CAFC81"> </td></tr><tr><td style=";"><span style="color: grey;">62.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <di:waypoint xsi:type="dc:Point" x="90.0" y="130.0"/> </td></tr><tr><td style=";"><span style="color: grey;">63.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <di:waypoint xsi:type="dc:Point" x="135.0" y="130.0"/> </td></tr><tr><td style=";"><span style="color: grey;">64.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <di:waypoint xsi:type="dc:Point" x="135.0" y="115.0"/> </td></tr><tr><td style=";"><span style="color: grey;">65.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <di:waypoint xsi:type="dc:Point" x="215.0" y="115.0"/> </td></tr><tr><td style=";"><span style="color: grey;">66.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      </bpmndi:BPMNEdge> </td></tr><tr><td style=";"><span style="color: grey;">67.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      <bpmndi:BPMNEdge id="_ptgaNANVEeK2lJvWBPLVRg" bpmnElement="_8A2D3B8A-B1F9-4993-B112-84458270EFAF"> </td></tr><tr><td style=";"><span style="color: grey;">68.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <di:waypoint xsi:type="dc:Point" x="215.0" y="115.0"/> </td></tr><tr><td style=";"><span style="color: grey;">69.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <di:waypoint xsi:type="dc:Point" x="305.0" y="115.0"/> </td></tr><tr><td style=";"><span style="color: grey;">70.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <di:waypoint xsi:type="dc:Point" x="305.0" y="130.0"/> </td></tr><tr><td style=";"><span style="color: grey;">71.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <di:waypoint xsi:type="dc:Point" x="395.0" y="130.0"/> </td></tr><tr><td style=";"><span style="color: grey;">72.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      </bpmndi:BPMNEdge> </td></tr><tr><td style=";"><span style="color: grey;">73.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      <bpmndi:BPMNEdge id="_ptgaNQNVEeK2lJvWBPLVRg" bpmnElement="_70594D97-F29D-4D84-B0DC-86312DFCB533"> </td></tr><tr><td style=";"><span style="color: grey;">74.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <di:waypoint xsi:type="dc:Point" x="395.0" y="130.0"/> </td></tr><tr><td style=";"><span style="color: grey;">75.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <di:waypoint xsi:type="dc:Point" x="618.0" y="130.0"/> </td></tr><tr><td style=";"><span style="color: grey;">76.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <di:waypoint xsi:type="dc:Point" x="618.0" y="111.0"/> </td></tr><tr><td style=";"><span style="color: grey;">77.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">        <di:waypoint xsi:type="dc:Point" x="803.0" y="109.0"/> </td></tr><tr><td style=";"><span style="color: grey;">78.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">      </bpmndi:BPMNEdge> </td></tr><tr><td style=";"><span style="color: grey;">79.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">    </bpmndi:BPMNPlane> </td></tr><tr><td style=";"><span style="color: grey;">80.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";">  </bpmndi:BPMNDiagram> </td></tr><tr><td style=";"><span style="color: grey;">81.</span></td><td style=";"><span style="color: green;">|</span></td><td style=";"></bpmn2:def<span style="color: red;">init</span>ions> </td></tr></tbody></table><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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>