[rules-users] Simple rules to "facts"; constraint "all members of a collection exist"

Ingomar Otter ingomar.otter at valtech.de
Mon Dec 10 20:03:04 EST 2007


Folks,
I have a buch of rather simple rules in a configuration use-case which
look like
rule "requires-rule"
when
    o1: O(id=2)
    o2:O(id=4)
   (not (exists (O(id=7))
then
   //assert a conflict "O2 and O4 require O7"

In subsequent rules I deal with the conflicts detected. The resolution
of these holds the "juicy bits".

As the above creates quite some text and does not allow me to reason
on the rule itself, I was thinking whether I should
introduce the "domain rule" (o2 & O4 require O7) as a fact and use
'meta rules' to do the processing.
Have you seen similar scenarios? Or is this misuse?

For the time being, I have modeled the requires-rule as something like
class RequiresDomainRule {
	Collection<Items> andTermItems; //eg o2, o4
         Item requiredItem; O7
}
Then I assert o2,o4 and a RequiresRule( (o2,o4),o6)
But I have a knot in my brain and can't get the LHS written down,
which in prose would be:
  there is a "requires rule" whose andTermItems are all present in WM
and whose requiredItem is not present in WM then...
The "andTermItems are all present"  got me. I can test for any but
all? - I'm stuck, need help.

Cheers,
   Ingomar

-- 
Ingomar Otter
Chief Technology Officer
mailto:ingomar.otter at valtech.de
Mobile: +49 172 2367867

Valtech GmbH
Bahnstraße 16
40212 Düsseldorf
Germany

Phone: +49 (0)211 179237-0
Fax: +49 211 179237-19

http://www.valtech.de

Geschäftsführer: Ingo Kriescher
Amtsgericht Düsseldorf HRB48672



More information about the rules-users mailing list