I'm new to Jess and
a key capability for me is retrieving complete match information (from
Java).
I can see how to get
the agenda and from that get a token and a list of facts.
The issue is how do
I associate that list of facts with the conditions/variables in the rule that
was being matched?
For example if I
had:
(defrule simple-rule
(child (id ?x) (name ?name))
(parent (id ?y) (child ?x))
=>
(printout t "Child " ?x " name " ?name crlf)
)
(child (id ?x) (name ?name))
(parent (id ?y) (child ?x))
=>
(printout t "Child " ?x " name " ?name crlf)
)
and I know fact-3
and fact-7 were matched...how can I tell (programmatically) which fact matched
which condition?
I'd also really like
to get partial match information as well...not just when the rule fired and
I'm less clear on how to even get started with that since the rule won't be in
the agenda.
Any help here would
be greatly appreciated and as I say I'm new to Jess so please point out the
obvious if there's a simple solution.
Thanks,
Doug