hi,

you can write a User function in java and load it in jess.
In Jess you can have a rule like this:

(defrule rule

?factId <- (Tag (ParentID 0))

=>

(myUserFunction ?factId))

From the call method of  the user function, you can get the Fact object from the FactIdValue.

I hope this works for  you.

Shankar

 

>From: "Vincent Wolowski" <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: [EMAIL PROTECTED]
>Subject: JESS: How do I get the fact-id?
>Date: Wed, 29 May 2002 20:02:15 +0200
>
>Hi,
>
>I have the following problem:
>
>In my knowledge base, there are facts like
>
>(deftemplate Tag
>(slot DocumentName)
>(slot ElementID)
>(slot TagName)
>(slot ParentID)
>(slot Text)
>(slot Element))
>
>(deffacts tagdata
>(Tag
>(DocumentName file:///C:/Jess60/service)
>(ElementID 2)
>(TagName name)
>(ParentID 0)
>(Text learning)
>(Element ))
>
>...and some more of those...
>
>I want to get from a Java program the fact-id of the fact, where the parentID is 0.
>
>I use the following rule:
>
>rete.executeCommand("(defrule getFactIDofRootElement"+
> "(Tag (ParentID 0))"+
> "=>"+
> "(?factID <- (Tag (ParentID 0))))");
>
>If I use the return value, the value is true.
>How can I get the fact-id and the fact itself in Java?
>I cant use assert, because the Jessfacts are already in the knowledge base.
>
>Thanks a lot for any hint!!!
>
>Vincent
>
>________________________________________________________________
>Keine verlorenen Lotto-Quittungen, keine vergessenen Gewinne mehr!
>Beim WEB.DE Lottoservice: http://tippen2.web.de/?x=13
>
>
>
>--------------------------------------------------------------------
>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]
>--------------------------------------------------------------------
>


Chat with friends online, try MSN Messenger: Click Here
-------------------------------------------------------------------- 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