Title: RE: JESS: Question about Defrule

Hi all,

I have been looking for a solution to something similar. I think the objective is to have an identifying property (an ID maybe) in all the beans. This is more related to his (Krishna Chaitanya's )first question. If we can get handle to individual objects we can track them using that property.

His second question though seems to be geared toward getting a list of partially satisfied rules. For goal oriented rules maybe. (?)


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Monday, September 17, 2001 10:38 AM
To: Krishna Chaitanya
Cc: [EMAIL PROTECTED]
Subject: Re: JESS: Question about Defrule



The getToken() method of Activation returns a jess.Token, which is
basically a list of facts that match a rule's LHS.

There is no way to get a list of all the rules for which at least one
fact is matched. Jess just doesn't work like that.

I should ask you, though, why you want to do all this? Maybe you'd be
more successful if you told us what you wanted to accomplish in more
general terms. There's probably a better way to do whatever it is.


I think Krishna Chaitanya wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> hi all,
>       I have created rules based on a template created from a bean in which i may
> use some or all the datamembers of the bean.I am instantiating the bean in
> the Java code.From the Rete object instance I could get all the rules that
> are activated from listActivations method.
>
> /**************code *********************/
>       Rete r = new Rete()
>       Iterator e = r.listActivations();
>       while(e.hasNext())
>       {
>               Activation a = (Activation) e.next();
>               Defrule dr = a.getRule();
>               //Problem is here.
>               String str  = dr.listNodes();
>       }
>
> //Problem is here
> 1)
> Now from the Defrule object obtained i wanted to get all the individual
> facts in that rule as well as their values.
> The listNodes() method in HasLHS will give me a string which is not
> needed.Can i get individual objects containing values??
> 2)
> can i get all the rules in which atleast one of the fact is fired??how can i
> get that??
>
> any help would be greatly appreciated.
>
> regards,
> Chaitanya.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
> in the BODY of a message to [EMAIL PROTECTED], NOT to the
> list (use your own address!) List problems? Notify [EMAIL PROTECTED]
> ---------------------------------------------------------------------
>



---------------------------------------------------------
Ernest Friedman-Hill 
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9012                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550

---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list (use your own address!) List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to