Sorry I agree with Christian not Scott!

I will try to refer to the correct email in my inbox next time ;-)

-----Original Message-----
From: Anstis, Michael (M.) 
Sent: 21 February 2008 14:00
To: 'Rules Users List'
Subject: RE: [rules-users] Plz reply : Descending order rule

Code:-

public static final void main(String[] args) {
        ...
        WorkingMemory wm = ruleBase.newStatefulSession();

        wm.insert(new Order(1));
        wm.insert(new Order(2));
        wm.insert(new Order(3));
        wm.fireAllRules();

        ...
} 

Rule:-

rule "Descending order"
    when
        $a : Order( $value : value )
        not Order( value > $value)
    then
        System.out.println("value :"+$value);                
        retract($a);
end

Gives:-

value :3
value :2
value :1

I agree with Scott, is there something else afoot?

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Christian Spurk
Sent: 21 February 2008 13:20
To: Rules Users List
Subject: Re: [rules-users] Plz reply : Descending order rule

Hi Barath!

Barath wrote:
> This indicates the rule should fire for three times but its not the case.

Looking at your last e-mail only: as far as I can see, the rule indeed 
fires exactly three times ... It prints the following:

value :3
value :2
value :1

Probably I don't quite understand the problem? Or maybe your actual 
problem does not occur in this simple testcase?

Best,
Christian
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to