Hello,
I have a class that looks like the following
package EventModule;
import java.util.Hashtable;
public class EventInfo {
private String eventName;
private Object[] userData;
/** Creates new EventInfo */
public EventInfo(String eventName, Object[] userData) {
this.eventName = eventName;
this.userData = userData;
}
public Object[] getUserData(){
return userData;
}
public String getEventName(){
return eventName;
}
}
I want to create an instance of this class in JESS. For the constructor as the second parameter I want to pass two Hashtables. How do I do it in JESS. I tried the code below with the create$ statement but it doesn't seem to work. The thing is I have created the two Hashtables before hand I just want to make and array out of the two and use them as a parameter in the constructor.
(reset)
(bind ?ht (new java.util.Hashtable))
(call ?ht put "Connections" "100")
(call ?ht put "Users" "80")
(bind ?ht2 (new java.util.Hashtable))
(call ?ht2 put "Connections2" "100")
(call ?ht2 put "Users2" "80")
(bind ?ei (new EventModule.EventInfo "DataBaseOverload" (create$ (?ht ?ht2))))
I get the following error
Jess reported an error in routine call
while executing (call ?ht ?ht2)
while executing (create$ (call ?ht ?ht2))
while executing (new EventModule.EventInfo "DataBaseOverload" (create$ (
call ?ht ?ht2)))
while executing (bind ?ei (new EventModule.EventInfo "DataBaseOverload"
(create$ (call ?ht ?ht2)))).
Message: No method named '{Users2=80, Connections2=100}' found in class java.u
til.Hashtable.
Program text: ( bind ?ei ( new EventModule.EventInfo "DataBaseOverload" ( crea
te$ ( ?ht ?ht2 ) ) ) ) at line 26.
at jess.w.call(Unknown Source)
at jess.ei.a(Unknown Source)
at jess.Funcall.execute(Unknown Source)
 !
; at jess.FuncallValue.resolveValue(Unknown Source)
at jess.ch.call(Unknown Source)
at jess.ei.a(Unknown Source)
at jess.Funcall.execute(Unknown Source)
at jess.FuncallValue.resolveValue(Unknown Source)
at jess.c2.call(Unknown Source)
at jess.ei.a(Unknown Source)
at jess.Funcall.execute(Unknown Source)
at jess.FuncallValue.resolveValue(Unknown Source)
at jess.cy.call(Unknown Source)
at jess.ei.a(Unknown Source)
at jess.Funcall.execute(Unknown Source!
)
at jess.Jesp.!
a(Unknown Source)
at jess.Jesp.case(Unknown Source)
at jess.Jesp.parse(Unknown Source)
at jess.Main.execute(Unknown Source)
at jess.Main.main(Unknown Source)
thanks
Richard.
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
