Hi all, 

    Inside jess working memory I place a shadow fact based on a bean (called
IMInformation) that contains a vector of different beans (called
InstrumentManagerParameter). If few words I would like to access to a filed
contained into an entry of the vector of beans.

 

The java object is the following: 

 

UML:
http://gladgw.lnl.infn.it:2002/ProblemSolver/doc/UML/PSEngine/IMInformation.
png 

 

JAVADOC:
http://gladgw.lnl.infn.it:2002/ProblemSolver/doc/org/gridcc/ie/impl/listener
/IMInformation.html 

 

SRC: 

 
http://ulisse.elettra.trieste.it/cgi-bin/viewcvs.cgi/gridcc/wp3/ProblemSolve
r/ProblemSolver/src/org/gridcc/ie/impl/listener/IMInformation.java?rev=1.1
<http://ulisse.elettra.trieste.it/cgi-bin/viewcvs.cgi/gridcc/wp3/ProblemSolv
er/ProblemSolver/src/org/gridcc/ie/impl/listener/IMInformation.java?rev=1.1&
content-type=text/vnd.viewcvs-markup> &content-type=text/vnd.viewcvs-markup

 

in order to present the object format to JESS I used the following
defclasses: 

(defclass event org.gridcc.ie.impl.listener.IMInformation) 

(defclass imParameter org.gridcc.ie.im.InstrumentManagerParameter) 

 

I also define the following rule: 

 

(defrule receivedEvent

(event (timestamp ?r&:(> ?r 1)) (imPar ?pars ) (instrumentManagerID ?id))

(bind ?p0 ?pars)

;; (bind ?v0 (call ?pars getValue ))

;;(bind ?p1 (nth$ 2 $?pars))

;;(bind ?v1 (call ?p1 getValue ))

=>

(printout t "NEW EVENT received at time " ?r " from " ?id " p0 " ?v0 crlf)

 

Unfortunately once triggered I obtain the following bad slot value: 

 

Message: Bad slot value . Program text: ( defrule receivedEvent ( event (
timestamp ?r & : ( > ?r 1 ) ) ( imPar ?pars ) ( instrumentManagerID ?id ) )
( bind ?v0 ( at line 10. 

at jess.Jesp.parseError(Jesp.java:162 

at jess.Jesp.parsePattern(Jesp.java:1363) 

at jess.Jesp.parseLHS(Jesp.java:1111) 

at jess.Jesp.doParseDefrule(Jesp.java:933) 

at jess.Jesp.parseDefrule(Jesp.java:893) 

at jess.Jesp.parseSexp(Jesp.java:149) 

at jess.Jesp.parse(Jesp.java:69) 

at jess.Jesp.parse(Jesp.java:54) 

at jess.Batch.batch(Batch.java:43) 

at jess.Batch.call(Batch.java:57) 

at jess.FunctionHolder.call(FunctionHolder.java:30) 

at jess.Funcall.execute(Funcall.java:266) 

at jess.Jesp.parseAndExecuteFuncall(Jesp.java:1596) 

at jess.Jesp.parseSexp(Jesp.java:173) 

at jess.Jesp.parse(Jesp.java:69) 

at jess.Rete.executeCommand(Rete.java:145 

at jess.Rete.executeCommand(Rete.java:1441) 

 

I'm sure that the fields of the java object are valorized and not null. I
didn't find the way to valorize p0 into the jess engine. 

 

Thx in advance for the helping 

Francesco 

 

 

 

Reply via email to