Re: [rules-users] Tutorial?

2007-06-01 Thread Geoffrey Wiseman
But if you go through the steps, you could write them down as you do and, voila, a tutorial for future users. On 5/31/07, Mark Proctor <[EMAIL PROTECTED]> wrote: nope Dou Hu wrote: New to this maling list. Any tutorial for 1. Deploy JBoss Rules to JBoss AS? 2. Start Web Based Visual Rul

Re: [rules-users] Use of Relational operator in Drools

2007-06-01 Thread Edson Tirelli
If you are using trunk, you can do: Classname( varname in ("1", "2", "3") ) Alternatively you can use connectives: Classname( varname == "1" || == "2" || == "3" ) []s Edson 2007/6/1, Rajesh.Sachin10 <[EMAIL PROTECTED]>: How to check a variable in a class contains any of the four o

[rules-users] Use of Relational operator in Drools

2007-06-01 Thread Rajesh.Sachin10
How to check a variable in a class contains any of the four or five value. I tried the below codes, but it throws error. Codes context : Context(state == Context.START_UP) exists Classname(varName : "1" || "2" || "3") context : Context(state == Context.START_UP) exists Classname(

[rules-users] Setting object's fields to complex result in RHS

2007-06-01 Thread Joj
Hi, Can't we write on RHS like: student.setTotal(mark1 + mark2); (where mark1 & 2 are variables in student) Is it possible? I mean arithmetical operations, calling Java methods, etc from inside setters. If not, is there any other logic to do the same? Please reply A.F.A.P. Jojan -- View thi

Re: [rules-users] Setting object's fields to complex result in RHS

2007-06-01 Thread Edson Tirelli
RHS is a java block, anything valid in java is valid there... are you sure you are binding the variables? when student : Student( mark1 : mark1, mark2 : mark2 ) then student.setTotal( mark1 + mark2 ); end []s Edson 2007/6/1, Joj <[EMAIL PROTECTED]>: Hi, Can't we write on RHS lik

[rules-users] Usage of 'exists' keyword to get the number of occurance?

2007-06-01 Thread Rajesh.Sachin10
Its possible to use 'exists' keyword to get the number of occurance? Eg: context : Context(state == Context:START_UP) exists ClassName(varName == "value") The ClassName is an Object array. So to get the number of occurance of the "value" in varName, we have any method or keywords? -- View

Re: [rules-users] Usage of 'exists' keyword to get the number of occurance?

2007-06-01 Thread Edson Tirelli
Nope, if you want actual instances you must use "collect": when context : Context(state == Context:START_UP) list : ArrayList( size > 0 ) from collect( ClassName(varName =="value" ) ) then // list has your matching ClassName objects end []s Edson 2007/6/1, Rajesh.Sachin10 <[EMAIL PRO

[rules-users] Re: Usage of 'exists' keyword to get the number of occurance?

2007-06-01 Thread Edson Tirelli
Yes, the "from collect" is new to 4.0. If you are using 3.0.6, you must use 2 rules and a helper class to do the count: rule "counting" salience 10 when $counter : Counter() Student( name == "Drools" ) then $counter.setValue( $counter.getValue() + 1 ); end rule "Total instances" whe