What is the timeframe for 3.1? Else/else if are very important to what we're trying to do. I can see how I can to the following with the method described by Geoffrey: if (A) then B else if (C) then D endif I also want to be able to do the following: if (A) then B else D endif I imagine that the rule would have to be written as a combo of if (A) then B endif if (!A) then D endif so that the conditions are complimentary...
________________________________ From: Michael Neale [mailto:[EMAIL PROTECTED] Sent: Mon 4/10/2006 2:42 AM To: [email protected] Subject: Re: [drools-user] How to express conditional logic via DRL - ? We are considering an ELSE for 3.1 - people are free to create a JIRA for this, and we can vote on it etc... There are a few options to the behaviour of else, but basically, on option is in the compile stage to build it into rules like Geoffrey described (probably lots of other ways). On 4/8/06, Geoffrey Wiseman <[EMAIL PROTECTED]> wrote: > > On 4/7/06, Dmitry Goldenberg <[EMAIL PROTECTED]> wrote: > > > > I'm trying to understand how to express conditional logic via DRL. For > > example, I have > > > [snip] > > I pretty much understand the flow of IF/THEN - how do you do an ELSE? > > > > With multiple rules, for the most part. For example: > > rule "Men Under Twenty" > when > $p : Person( male==true, age<20 ) > then > $p.doSomething(); > end > > rule "Men Over Twenty and Women" > when > $p : ( Person( male==false ) || Person( age >= 20 ) ) > then > $p.doSomething(); > end > > -- > Geoffrey Wiseman > >
