[rules-users] newbie question on "when" condition syntax

mashup richard.bremner.nb at googlemail.com
Fri May 2 15:41:35 EDT 2008


Thanks Chris, that does work. 

oh man, I tried something so similar to that with the parenethisis last
night using my "programming by trial and error" methodology.

many thanks to everyone who replied, it's all been a great help!

Richard


Chris Woodrow wrote:
> 
> Hi,
> even
> Test (y == (x + 1))
> works.
> 
> Richard : I think you should take a look at this before planning doing
> complicated calculations with drools
> http://lists.jboss.org/pipermail/rules-users/2008-April/005247.html but it
> might be fixed now.
> 
> Chris
> 
> 
> 2008/5/2 Raffi Khatchadourian <khatchad at cse.ohio-state.edu>:
> 
>> On Fri  2.May'08 at 10:05:20 +0100, Anstis, Michael (M.) wrote:
>>
>> > The "when" section matches fact (object) patterns, so your requirement
>> > could be written as:-
>> >
>> > when there is a Test Fact 'A' and another Test Fact 'B' where "the 'x'
>> > property of 'A'" equals "the 'y' property of fact 'B' plus 1" then.....
>> >
>> > This would become:-
>> >
>> > rule "Rule 1"
>> > when
>> >   Test( $y : y )
>> >   Test( x == ($y + 1) )
>> >
>>
>> Could you combine these conditions? As in:
>>
>> when
>>        Test($y : y, x == $y + 1)
>> //...
>> _______________________________________________
>> 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
> 
> 

-- 
View this message in context: http://www.nabble.com/newbie-question-on-%22when%22-condition-syntax-tp17015309p17026473.html
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list