[ http://jira.codehaus.org/browse/DROOLS-486?page=all ]
     
Russ Ray closed DROOLS-486:
---------------------------

    Resolution: Cannot Reproduce

This is not an issue.  This is a user understanding issue.  The priorities were 
incorrect and filtering was being used which prevented all the rules from 
firing.......

> Chaining Rules Together
> -----------------------
>
>          Key: DROOLS-486
>          URL: http://jira.codehaus.org/browse/DROOLS-486
>      Project: drools
>         Type: Bug

>   Components: semantics.java
>     Versions: 2.5
>  Environment: Windows XP, 
>     Reporter: Russ Ray
>  Attachments: Chain_rules_problem.rtf
>
>
> When chaining together four rules in such a way that no one rule is fired 
> more than once and each rule is excuted squentially based upon a priority, 
> the second rule does not fire.
> Here are the 4 rules.
>     <!-- priority and no recursive rule -->
>    <rule name="AssignTask" salience="-1" no-loop="true">
>       <!-- What is being passed into the rule -->
>       <parameter identifier="taskVO1">
>          <class>TaskVO</class>
>       </parameter>
>        <!--  What conditions must be true before rule is asserted -->
>       <java:condition>taskVO1.getIdentifiersList() != null || 
> taskVO1.isIdentifiersListEmpty() == false</java:condition>
>       <java:condition>taskVO1.getActionStep().equalsIgnoreCase("AWAIT 
> EVAL")== true </java:condition>
>       <java:condition>taskVO1.containsIdentifier("CONTRACT", "S#1234567890") 
> == true</java:condition>
>       
>       <!-- What does the rule does for us -->
>       <java:consequence>
>           System.out.println("*****************************  in consequence 
> for rule1");
>           taskVO1.setDepartment("DPT1");
>           taskVO1.setDptCode(lookupDeptCode("DPT1"));
>           taskVO1.setWorkBasket("rray");
>           taskVO1.setTaskType("ADFPAYCHK");
>           taskVO1.setTskCode(lookupTaskTypeCode("ADFPAYCHK"));
>           taskVO1.setActionStep("INDEX");
>           taskVO1.setActCode(lookupActStepCode("INDEX"));
>           taskVO1.setStatus("OPEN");
>           //printTaskVO(taskVO1);
>           <!-- Firing any other rules based on changes -->
>           drools.modifyObject(taskVO1);
>       </java:consequence>    
>    </rule>
>    
>       <!-- priority and no recursive rule -->
>    <rule name="AuditTask" salience="0" no-loop="true">
>       <!-- What is being passed into the rule -->
>       <parameter identifier="taskVO2">
>          <class>TaskVO</class>
>       </parameter>
>        <!--  What conditions must be true before rule is asserted -->
>       <java:condition>taskVO2.getStatus().equalsIgnoreCase("OPEN") == 
> true</java:condition>
>       <java:condition>taskVO2.getTaskType().equalsIgnoreCase("ADFPAYCHK") == 
> true</java:condition>
>       <java:condition>taskVO2.getActionStep().equalsIgnoreCase("INDEX")== 
> true </java:condition>
>       <java:condition>taskVO2.containsIdentifier("CONTRACT", "S#1234567890") 
> == true</java:condition>
>       
>       
>       <!-- What does the rule does for us -->
>       <java:consequence>
>           System.out.println("*****************************  in consequence 
> for rule2");
>           IdentifierVO ident = new IdentifierVO();
>                 ident.setTaskId("t1234567890");
>                 ident.addField("COMPANY20060313-0000001");
>                 ident.addFieldName("AUDIT NBR");
>                 ident.addFieldSize(45);
>                 ident.setIdDesc("AUDIT NBR");
>                 //printIdentVO(ident);
>                 taskVO2.addIdentifier(ident);
>                 taskVO2.setActionStep("PROCESS");
>           //printTaskVO(taskVO2);
>           <!-- Firing any other rules based on changes -->
>           drools.modifyObject(taskVO2);
>       </java:consequence>    
>    </rule>
>    
>         <!-- priority and no recursive rule -->
>    <rule name="RouteTask" salience="1" no-loop="true">
>       <!-- What is being passed into the rule -->
>       <parameter identifier="taskVO3">
>          <class>TaskVO</class>
>       </parameter>
>        <!--  What conditions must be true before rule is asserted -->
>       <java:condition>taskVO3.getStatus().equalsIgnoreCase("OPEN") == true 
> </java:condition>
>       <java:condition>taskVO3.getTaskType().equalsIgnoreCase("ADFPAYCHK") == 
> true</java:condition>
>         <java:condition>!taskVO3.getActionStep().equalsIgnoreCase("QC")== 
> true </java:condition>
>       <java:condition>taskVO3.containsIdentifier("AUDIT NBR", 
> "COMPANY20060313-0000001") == true</java:condition>
>       
>       <!-- What does the rule does for us -->
>       <java:consequence>
>            System.out.println("*****************************  in consequence 
> for rule3");
>           taskVO3.setWorkBasket("mightymouse");
>           taskVO3.setStatus("REVIEW");
>           //printTaskVO(taskVO3);
>           <!-- Firing any other rules based on changes -->
>           drools.modifyObject(taskVO3);
>       </java:consequence>    
>    </rule>
>    
>    
>    
>    <!-- priority and no recursive rule -->
>    <rule name="SuspendTask" salience="2" no-loop="true">
>       <!-- What is being passed into the rule -->
>       <parameter identifier="taskVO4">
>          <class>TaskVO</class>
>       </parameter>
>        <!--  What conditions must be true before rule is asserted -->
>       <java:condition>taskVO4.getTaskType().equals("ADFPAYCHK") == 
> true</java:condition>
>       <java:condition>taskVO4.getStatus().equalsIgnoreCase("REVIEW") == 
> true</java:condition>
>       <java:condition>taskVO4.getCaseDesc().equalsIgnoreCase("missing 
> signature") == true</java:condition>
>       
>       <!-- What does the rule does for us -->
>       <java:consequence>
>           System.out.println("*****************************  in consequence 
> for rule4");
>           taskVO4.setStatus("SUSPEND");
>           taskVO4.setSuspOper("MightyMouse");
>           taskVO4.setCaseDesc("missing signature");
>           taskVO4.setCaseId("C1234567890");
>           //printTaskVO(taskVO4);
>           <!-- Firing any other rules based on changes -->
>           drools.modifyObject(taskVO4);
>       </java:consequence>    
>    </rule>
> Only the first rule is fired.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to