[rules-users] URGENT - using lock-on-active or not

Mark Proctor mproctor at codehaus.org
Thu Sep 16 06:36:35 EDT 2010


  please don't title your subjects with URGENT. i'm sure everyone's 
email here is urgent. See netiquette here:
http://www.jboss.org/drools/lists.html

Mark
On 16/09/2010 08:55, Yaniv Itzhaki wrote:
>
> Hi All,
>
> I have an urgent problem which I hope someone can explain it to me and 
> how it can be solved.
>
> I created 2 rules "Update 1" and "Update 2", basically the rules are 
> the same, get all the CaseLog objects according to "Category" and 
> "Value" and update the Case, which holds a list of CaseLogs, with a 
> new object.
>
> Note that in the update method I am updating the working memory by 
> retracting the old log and inserting the new one.
>
> Now for the problem:
>
>
> The problem is that on one hand, when I insert a new log line all 
> rules without lock-on-active re-fire. On the other hand, rules with 
> lock-on-active seem to disregard the addition of the new object and 
> fire only on the lines that were present when their group was activated.
>
> Please see the rules below
>
> Thanks
>
> Yaniv
>
> * *
>
> *rule* "Update 1"
>
> *salience* 4
>
> *ruleflow-group* "group1"
>
> *lock-on-active*
>
> *when*
>
>             $case : Case()
>
>             $myLog : CaseLog( myClass == "Category",
>
>                   myValue == "1" )
>
> *then*
>
>             System.out.println("Logic: Update 1");
>
>             $case.update($myLog,40.0,*null*);
>
> *end*
>
> *rule* "Update 2"
>
> *salience* 0
>
> *ruleflow-group* "group1"
>
> *lock-on-active*
>
> *when*
>
>             $case : Case()
>
>             $myLog : CaseLog( myClass == "Category",
>
>                   myValue == "1", $score : myScore )
>
> *then*
>
>             System.out.println("Logic: Update 2 " + $score + 5.0);
>
>             $case.update($myLog,$score + 5,*null*);
>
> *end*
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20100916/219f9a60/attachment.html 


More information about the rules-users mailing list