I’ve got a fact which contains a collection (a set of
strings to be precise). I want to write a rule which fires if there are any
invalid values (where the valid values are defined as a list).
What I’m trying to do is express this within a
decision table.
Expressed as a drl rule the following works:
rule "ValidateList"
when
Fact(col
: collection != null)
String(this not in ($param)) from col
Then
#generate
error
End
Where $param = ‘“1”, “3”, “valid”’
The decision tables seem to assume that the fact type is the
last element in the line and then appends “( conditions... )” this
means there is no way to then insert a “from ...” after it.
Does anybody know either a different way to structure the rule
so that I don’t need a from or a way to get the decision table to use it?
(unfortunately adding the collection directly as a fact isn’t an option).
Thanks,
Thomas