Re: JESS: trigger when all referred elements of a list in a particular state?

2008-07-23 Thread Hal Hildebrand
On Jul 23, 2008, at 6:50 PM, Ernest Friedman-Hill wrote: The "forall" conditional element can do this: (defrule something-like-this (forall (some-state (list-o-things $? ?thing-id $?)) (thing (id ?thing-id) (state "2"))) => (do-something) ) This basically reads "If for

Re: JESS: trigger when all referred elements of a list in a particular state?

2008-07-23 Thread Ernest Friedman-Hill
The "forall" conditional element can do this: (defrule something-like-this (forall (some-state (list-o-things $? ?thing-id $?)) (thing (id ?thing-id) (state "2"))) => (do-something) ) This basically reads "If for all ways of matching the first pattern, there's a mat

JESS: trigger when all referred elements of a list in a particular state?

2008-07-23 Thread Hal Hildebrand
Sorry for the wacky subject line, but can't think of a good way to describe what I'm attempting. Suppose I had something like the following: (deftemplate some-state (multislot list-o-things)) (deftemplate thing (slot id) (slot state (default "1"))) (defrule transition-2 (some-state (list-o-