[rules-users] Should update be called moving from one rule task to another in a ruleflow

Wishing Carebear wishing.carebear at gmail.com
Wed Jul 13 16:18:11 EDT 2011


PotentialTheft ruleflow-group updates a simple String
attribute(potentialTheftRating) as shown below. The next step
(checkTheftRating used as an example here) uses the potentialTheftRating in
the condition. Note that some of the attributes are list of objects where
the update is on the attribute of the contained object in the list.

*//TheftRating ruleflow-group
*
rule  "Row 1 PotentialTheft.gdst"
    ruleflow-group  "TheftRating"
    lock-on-active true

    dialect  "mvel"
    when
        $car : Vehicle( convertible ==  "true"  )
    then
        System.out.println(" row 1 ");
        //$car.setPotentialTheftRating(  "high" );
        modify($car){
            setPotentialTheftRating(  "high" );
        }
        //update($car);
end

 #from row number: 2
rule  "Row 2 PotentialTheft.gdst"
    ruleflow-group  "TheftRatinggrp"
    dialect  "mvel"
    when
        $car : Vehicle( price >=  "45001" , price <=  "200000" )
    then
        $car.setPotentialTheftRating(  "high" );
        System.out.println("row number: 2");
end

*//CheckTheftRating ruleflow-group*

rule  "1 CheckTheftRating"
    ruleflow-group "CheckTheftRating"
    salience 100
    dialect  "mvel"
    when
        $car : Vehicle( potentialTheftRating ==  "high"  )
    then
        System.out.println(" CheckTheftRating is true");
end

Regards,
Ravi


On Wed, Jul 13, 2011 at 8:28 AM, Tihomir Surdilovic <tsurdilo at redhat.com>wrote:

> How about show your code and rules and maybe relevant parts of your
> process? Would help understand your situation better.  I would think
> creating a simple test case that covers your scenario would not take
> long to put together.
>
> Thanks.
> On 7/13/11 11:20 AM, Wishing Carebear wrote:
> > Any pointers please!!
> >
> > On Tuesday, July 12, 2011, Wishing Carebear<wishing.carebear at gmail.com>
>  wrote:
> >> Any pointers?
> >>
> >> On Tuesday, July 12, 2011, Wishing Carebear<wishing.carebear at gmail.com>
>  wrote:
> >>> Hi,
> >>> If I have a ruleflow with a sequence of rule tasks, should an update be
> called to reflect the state of the fact in the working memory? In another
> words If all the rules are mutually exclusive within a rule task, will the
> changes made in first rule task, if used as a condition in the next rule
> task will be reflected without calling explicit update.
> >>>
> >>> Thanks for your time and help.
> >>>
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
> >
>
> _______________________________________________
> 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/20110713/04c38138/attachment.html 


More information about the rules-users mailing list