Re: [rules-users] Convert logic to DRL rules

2007-02-19 Thread Bill Zhang
Hi Steven, Yes I thought of that but our business user says this is unacceptable unless I can write a parser to automatically generate all these combinations. The example I use is quite simple. Our business user have quite complex logic expressions (imagin my example plus a lot of parenthesis

Re: [rules-users] Convert logic to DRL rules

2007-02-19 Thread Bill Zhang
Hi Alex, Thank you for confirming this. Writing such a builder may take us a lot of time because our business user is used to free style Pascal-like authoring using quite complex logic. For example, IF ( ( (Person.Age 35 OR Person.Age 25) AND (Person.ZipCode =23546 or Person.ZipCode =

Re: [rules-users] Convert logic to DRL rules

2007-02-19 Thread Edson Tirelli
Bill, The way of doing that is using connective constraints as explained by Steven previously: $a : Person(age 35 | 25, zipCode == 23546 | == 68590) This is a new feature that only works in 3.1M1 and later versions. []s Edson Bill Zhang wrote: Hi Steven, Yes I thought of

Re: [rules-users] Convert logic to DRL rules

2007-02-19 Thread Edson Tirelli
Bill, Your statement bellow can be written in 3.1M1 as: rule ... when $person : ( Person( age 35 | 25, zipCode == 23546 | == 68570, $lop: lastOrderPrice, $ton: totalOrderNumber,

Re: [rules-users] Convert logic to DRL rules

2007-02-19 Thread Edson Tirelli
) ) Then // do smth using $p End Or smth along those lines... Would that work?. Vlad -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bill Zhang Sent: 19 February 2007 09:14 To: Rules Users List Subject: Re: [rules-users] Convert logic to DRL

Re: [rules-users] Convert logic to DRL rules

2007-02-19 Thread Bill Zhang
that work?. Vlad -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bill Zhang Sent: 19 February 2007 09:14 To: Rules Users List Subject: Re: [rules-users] Convert logic to DRL rules Hi Alex, Thank you for confirming this. Writing such a builder may take

Re: [rules-users] Convert logic to DRL rules

2007-02-19 Thread Edson Tirelli
Bill, The new version works fine with nested conditional elements and allow for any level of nesting. You simply must be very careful with OR as the semantics of OR in a rules engine are not exactly the same as most people are used to in imperative programming. Also, the syntax you

Re: [rules-users] Convert logic to DRL rules

2007-02-19 Thread Mark Proctor
'and' is not needed at top level, it is implicitely assumed that all patters are under an 'and' CE. Mark Bill Zhang wrote: Edson, Thanks for the reply. The rule you authored worked fine on my new Drools build from SVN. However, I did notice that the following pattern matching is not working:

Re: [rules-users] Convert logic to DRL rules

2007-02-19 Thread Bill Zhang
Edson and Mark, Thank you for your help. I have the complete rule expressed in PASCAL-like language in the following. Mark mentioned that and is not needed at top level but I am not sure what syntax I can use to express the top-level and in the following rule when the top-level and is used to

RE: [rules-users] Convert logic to DRL rules

2007-02-19 Thread Olenin, Vladimir (MOH)
...). Thanks, Vlad -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Edson Tirelli Sent: 19 February 2007 11:05 To: Rules Users List Subject: Re: [rules-users] Convert logic to DRL rules Vlad, I think that for Bill's case, the object structure

Re: [rules-users] Convert logic to DRL rules

2007-02-18 Thread Bill Zhang
Hi Steven, Thank you very much for your help. Really appreciate. I still got the same error, Unexpected token '|'. I did not see | in the document, only saw ||, which is supposed to be used with columns. Ye On 2/18/07, Steven Williams [EMAIL PROTECTED] wrote: Hi Bill, I think it should be:

Re: [rules-users] Convert logic to DRL rules

2007-02-18 Thread Alexander Varakin
As far as I know this syntax is new and is available in SVN only, you will have to wait till 3.1 is released or take source from SVN and build it. Bill Zhang wrote: Hi Steven, Thank you very much for your help. Really appreciate. I still got the same error, Unexpected token '|'. I did not

Re: [rules-users] Convert logic to DRL rules

2007-02-18 Thread Alexander Varakin
We built a Rule Builder which creates drl with all possible combinations. In any case, drl syntax is not exactly business user friendly, so having such builder is not a bad idea. Simple Rule Builder can be implemented as an Excel spreadsheet, which can be easily parsed using POI library and then

[rules-users] Convert logic to DRL rules

2007-02-17 Thread Bill Zhang
Hello, I am a new Drools user trying to convert the following simple logic into DRL: IF (Person.Age 35 OR Person.Age 25) AND (Person.ZipCode = 23546 or Person.ZipCode = 68590) THEN Person.Status = KT; I found that it is not easy to convert the above logic into ONE DRL rule. I tried

Re: [rules-users] Convert logic to DRL rules

2007-02-17 Thread Steven Williams
In trunk I think you can use connective constraints: $a : Person(age 35 | 25, zipCode == 23546 | == 68590) then $a.setStatus(KT); On 2/18/07, Bill Zhang [EMAIL PROTECTED] wrote: Hello, I am a new Drools user trying to convert the following simple logic into DRL: IF (Person.Age 35 OR