Hi, 

I'm having problems to call a java function from a rule in Jess.

I have a JavaBean named JessAgent and this java has a function that
continues to decrease an int, when this int reaches a value I want to call a
function from that javaBean.

Here's an example of what I wanted to achieve:

                                (defclass agent JessAgent)
                                (ppdeftemplate agent)
                                (bind ?da (new JessAgent))
                                (definstance agent ?da static)
                                (?da lifeDown)
                                (?da warning)

//This works fine, I call the functions lifeDown and warning that are
defined in the JavaBeans and no problem Here then

                                (defrule watchlife
                                (agent (life ?x&:(< ?x 70)))
                                 =>
                                (bind ?tt (new JessAgent))
                                (definstance agent ?tt static)
                                (?tt warning))

//I want to call the function warning in the RHS but without creating a new
instantiation of the bean, I want to call the warning from the variable ?da
defined up there.

How can I do it?

Thanks in Advance!

-- 
View this message in context: 
http://www.nabble.com/Call-a-java-function-from-rules-in-jess-tf2858806.html#a7987154
Sent from the Jess mailing list archive at Nabble.com.
--------------------------------------------------------------------
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