One rules is fired per cycle, so it depends the rules that it's fired first.
You are right it's totally up to the conflict resolution strategy.
HI,
There was an interesting discussion today on IRC; a user "jochen" reported NPEs when trying to iterate lists in the RHS constructed in the LHS using "from collect".
I was wondering how Drools handles lists constructed in the LHS; if the list contained 5 elements but another rule retracted one of those elements would the list available in the RHS contain 4 or 5 elements?
Here's a simplification of what was posted at http://pastebin.com/yKGSxFkA
Rule 1
when
$cheese : ArrayList() from collect(CheeseFact());
then
for(int i=0; i<$cheese.size(); i++) {
//Something useful…
}
endWhat if there was another rule that did something like this:-
Rule 2
When
$cf : CheeseFact(type == "chedder")
Then
retract($cf);
endWhat would be the list Rule 1 iterates?
I'd assume since I believe activation execution to be serial it would depend on the agenda's conflict resolution strategy or rule salience?
What would be the learned opinion?
With kind regards,
Mike
_______________________________________________
rules-dev mailing list
rules-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev