Yes, it is straight forward. Just bind the OBJECT slot to a variable, this
is that fact's
Java object reference. This object's methods can then be called on the RHS,
as shown in
the example below.
(defrule cleanUpMessagePlatformStatus
(declare (salience -20))
(PlatformStatus
(frame "MESSAGE")
(OBJECT ?orf)
)
=>
(?orf setFrame "HISTORY")
)
Where the PlatformStatus is delcared, in part, as:
public class PlatformStatus {
protected String Frame;
public String getFrame() {return Frame; }
public void setFrame( String newFrame) {
pcs.firePropertyChange("frame",Frame, newFrame);
Frame = newFrame;
}
}
In this case frame is also a property that could be set directly from Jess,
but any
public method can be used in this way.
- Lewis
___________________________________________
Lewis L Hart
GRC International [EMAIL PROTECTED]
1900 Gallows Rd. Voice (703)506-5938
Vienna, Va 22182 Fax (703)556-4261
-----Original Message-----
From: chinnaswamy gounder [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 15, 2001 6:58 AM
To: [EMAIL PROTECTED]
Subject: JESS: Re: Action part of rules
Hi All,
The examples I have gone through, action of the rules
do have print a message, call a jess function, assert
a rules, retract a rule. But can I play with a Java
Object that has been transfered into jess script.
i.e. If I transfer a Java object to jess from my
application through defclass & definstance, can I
invoke one of the methods of the transferred object
from the action part of a rule.
Thanks and regards
Chinnaswamy
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.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]
---------------------------------------------------------------------
---------------------------------------------------------------------
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]
---------------------------------------------------------------------