Dear Jess users.

What I am trying to do is to dynamically list all the defrules together
with their LHS and RHS facts excluding any conditions. Basically what I
mean is that, for example, if there are Person and Car facts on the rule's
LHS and the rule asserts an Owner fact, deletes the Car fact and modifies
the Person fact. I would like to create a data structure that would, for
each rule, carry it's name and the facts it needs to fire (excluding any
conditions just deftemplate's name) and any deftemplates that appear on the
rule's RHS. So for the example above, something like:
 needs: Person, Car
 asserts: Owner
 modifies: Person
 deletes: Car

I can get a list of all defrules via the listDefrules() method called on
the Rete object but then it gets tricky. The listNodes() method called on
the HasLHS object gives a textual description of the rule's LHS but I
cannot find a method that would simply return name of facts on the LHS.
Some text processing would solve the rule's LHS problem as I can look for
occurrences of "::" to find facts. However, the rule's RHS is more
problematic as I cannot find a method that would give me what I want.

I would appreciate your help with this one.

Best regards,

Przemyslaw (Pete) Woznowski, PhD candidate & RA
Room C/2.06, Desk 8
Cardiff School of Computer Science & Informatics,
Cardiff University,
Queen's Buildings,
5 The Parade, Roath,
Cardiff, CF24 3AA, UK
& School of Healthcare Studies,
Cardiff University
Cardigan House
Heath Park Campus
Cardiff, CF14 4XN, UK

Reply via email to