[rules-users] variable 'or' constraints with a DSL
Reid Kaufmann
Reid.Kaufmann at Sun.COM
Tue Jul 15 11:32:54 EDT 2008
I really like how you can specify a DSL like this (for example):
[condition]There is a person=$p : Person()
[condition]- with {color} hair=hairColor matches {color}
[condition]- with {color} eyes=eyeColor matches {color}
[condition]- that is {height} inches tall =height == {height}
[condition]- that is {age} years old=yearsOld == {age}
If I'm reading the documentation correctly, the rules can then be
specified with any subset of the constraints (lines beginning with
"-"). These constraints are then essentially ANDed together since they
are comma separated when converted to DRL. Since they are called
constraints, this makes sense. My question is this: Is there a similar
way to allow a variable number of "constraints" that are all ORed ("||")
together?
I've been reading the documentation and searching mail archives and so
far haven't found anything helpful. Let me know if there is a way to do
this or any clever workarounds, since I don't want to delineate every
possible combination of attributes when OR is needed.
reid
More information about the rules-users
mailing list