[rules-users] Accessing collections in conditional statements (inside/outside working memory)

Evert Penninckx evert.penninckx at gmail.com
Mon Jun 21 16:32:35 EDT 2010



Edson Tirelli-3 wrote:
> 
>     If you have only one or two rules using "from $collection", you are
> probably ok. If you have more, the "from" will probably be much heavier
> than
> inserting facts into the working memory (assuming not all of your "from"
> conditions will be shared among rules) by the reasons stated by Thomas,
> even
> if you are not modifying facts.
> 

My parent does have a number of child collections with unidirectional
relations. So my rules often make use of them. Making the relations
bidirectional would only serve to optimize rules. Something to keep in mind
if we'd run into performance problems.


Edson Tirelli-3 wrote:
> 
>     Also, remember you can negate operators:
> Parent( collection contains $child )
> Parent( collection not contains $child )
>     That is more efficient than composing "exists"/"not" and "from".
> 

True, but "children not contains $child" expects to have the Child bound in
a previous condition, implying (to my understanding) that "a" child must be
present to match the condition, while this might not and, in my rule,
mustn't be the case at all. 


Evert


-- 
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Accessing-collections-in-conditional-statements-inside-outside-working-memory-tp905005p912612.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list