Re: [rules-users] Accepted idiom for binding variable to restriction?

2010-06-03 Thread Evert Penninckx
Edson Tirelli-3 wrote: > >For simple constraints like this, using nested accessors is lighter and > simpler than using from. > Phrases like this should go in a drools best practice sections :-) Does something like that exist? When you read the docs, you get the impression that "from" is

Re: [rules-users] Accepted idiom for binding variable to restriction?

2010-06-03 Thread Edson Tirelli
For simple constraints like this, using nested accessors is lighter and simpler than using from. Edson 2010/6/3 Giovanni Motta > Why not use from? The manual suggest this approach to reason over data that > is not explicitly asserted in knowledge base. It seems to me that it fits > best i

Re: [rules-users] Accepted idiom for binding variable to restriction?

2010-06-03 Thread Giovanni Motta
Why not use from? The manual suggest this approach to reason over data that is not explicitly asserted in knowledge base. It seems to me that it fits best in the requirement of Laird. Please correct me if this is bad practice: $response: Response() $question: Question(ID == "XYZ") from $response.qu

Re: [rules-users] Accepted idiom for binding variable to restriction?

2010-06-02 Thread Edson Tirelli
Syntactically speaking, I don't think the eval is necessary: $response : Response( $question : question, question.ID == "XYZ" ) Behind the scenes Drools will still generate an eval to resolve the nested property constraint, but the rule stays simple to read and maintain. Edson 2010/6

Re: [rules-users] Accepted idiom for binding variable to restriction?

2010-06-02 Thread Wolfgang Laun
The "inline eval" constraint is what you want: a boolean expression, within parentheses. $response : Response( $question : question, eval(question.getID().equals( "XYZ" ) ) ) See the Drools Expert manual, section on "Left Hand Side..." -W On 1 June 2010 23:54, Laird Nelson wrote: > I have a

[rules-users] Accepted idiom for binding variable to restriction?

2010-06-01 Thread Laird Nelson
I have a fact that is inserted into my rule base. It is a Response. A Response has a Question that it is a response to. At the moment, the Question itself is not separately inserted into the knowledge base. I would ideally like to keep it this way. What's the best approach for binding variable