Hello,
I am currently working with Drools Decision tables, and have created a
decision table to determine availability of offers.
I have Offer Entities which contain a collection of "groups" that the offer
can belong to. That collection contains strings of ids that identify those
groups.
The decision table essentially has two columns, where the first column
checks to see if any of the comma separated list of group ids are present in
the collection items of the offer entities in working memory. So essentially
I'm trying to do a many to many existence check here.
So for example:
Let us suppose we have the following two offer entities:
Offer 1:
Name: "Acme Mice"
Groups: {"70104","70004","70000"}
Offer 2:
Name: "Acme Keyboard"
Groups "{"70104", "50404, "32825"}
Now in my decision table I have the following condition for checking the
"groups property"
CONDITION
ACTION
o: Offer
forall(||){groups contains $}
o.setAvail($param);
Offers that contain any of the following group ids
Is Available?
"70000","70104"
TRUE
""
TRUE
Now this works fine for those groups that are mentioned, but the second rule
which is the case where the group condition doesn't matter, but still needs
to fire the rule and result in action of set Avail to true, never happens.
This appears to be because the empty string "" is not contained in the
collection of groups.
Has anyone experienced this and know a way around this? I've tried checking
to see if the "" == $param or null, but I get errors like:
Description Resource Path Location Type
[ERR 101] Line 20:41 no viable alternative at input '""' in rule
"Availability_11" in pattern Offer Availability.xls
Thanks for your time!
--
View this message in context:
http://drools-java-rules-engine.46999.n3.nabble.com/Decision-Table-evalua...
Sent from the Drools - User mailing list archive at
Nabble.com.