[rules-users] Evaluate rules for multiple facts of the same type within a StateuflSession

pdario dario.piantanida at gmail.com
Mon Feb 18 11:06:42 EST 2013


laune wrote
> There is always just one fit; it just seems that there are multiple
> fits - when you define your individual cases sloppily.

Well, this is an assumption to get a completely disjointed classification,
but this is not my case.

I have a first level discount if you pay online and a second level discount
if you pay online AND buy a special product.

So, the second is true only if the first is.


laune wrote
>> when
>>   Cart ($items : buyingItems, payment == Card....)
>>   i : Item (code == XXXXX) from $items
>> then
> 
> I don't see why "XXXXX" shouldn't come from a parameter fact.
> 
> As a general strategy, I try to avoid the "on-the-fly" objects
> available with "from" and prefer these subordinate items to be
> properly inserted facts. Usually this simplifies writing rules.

If I simply put several carts and the whole items form them into memory, it
would create a mess of carts and items, won't it?
What will keep each item with its own cart?



--
View this message in context: http://drools.46999.n3.nabble.com/Evaluate-rules-for-multiple-facts-of-the-same-type-within-a-StateuflSession-tp4022157p4022411.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list