Definstance facts have an OBJECT slot which contains the Bean as an
EXTERNAL_ADDRESS. Instead of binding the pattern to ?aTask, instead
you match the OBJECT slot with ?aTask. See for example manual section
2.7.4., "Definstance Facts"


I think Ed Meier wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> I don't do the "definstance" below. I had just put that as a potential
> workaround. I guess I didn't proofread that well enough.
> 
> Here's what the code snippet should be:
> ***
> 
> (defrule is-clearpayment-task
> ?atask <- (task (verb ?v&:(verbmatch ?v "CLEARPAYMENT") ))
> (not (removed ?uid&:(eq ?uid (call ?atask getUID))))
> =>
> (printout t "JESS: clear payment task found" crlf)
> (assert (ccprep (call ?atask getPrepositionalPhrase (new java.lang.String
> "WITHCREDITCARD")) (call ?atask getPreferredValue 3) ))
> 
> 
> 
> 
> ----- Original Message -----
> From: "Ed Meier" <[EMAIL PROTECTED]>
> To: "Jess" <[EMAIL PROTECTED]>
> Sent: Friday, September 29, 2000 3:07 PM
> Subject: JESS: fact to external address?
> 
> 
> > Jess Wizards,
> >     Thanks again for all your previous help. I have another ponderer.
> Well,
> > it's hard for me anyway.
> >
> > I have some rules that work with definstance facts. That is I defclass the
> > classes, and when certain definstances come along I want to act on them.
> > Simple enough. What seems to be happening though is that when the
> > definstance item hits the "execute" part of the rule it is only a fact. I
> > get "Not an external address: "<Fact-0>" (type = FACT_ID).
> >
> > Here are the relevant snippets of the code:
> >
> > ***
> > (deftemplate task class.path.to.TaskImpl)
> >
> > (defrule is-clearpayment-task
> >    ?atask <- (task (verb ?v&:(verbmatch ?v "CLEARPAYMENT") ))
> >    (not (removed ?uid&:(eq ?uid (call ?atask getUID))))
> > =>
> >    (printout t "JESS: clear payment task found" crlf)
> >    (definstance task ?atask static)
> >    (assert (ccprep (call ?atask getPrepositionalPhrase (new
> java.lang.String
> > "WITHCREDITCARD")) (call ?atask getPreferredValue 3) ))
> > )
> >
> > ****
> > Here's part of the error text:
> >
> > JESS: clear payment task found
> > Jess reported an error in routine Value.externalAddressValue while
> executing
> > (ca
> > ll ?atask getPrepositionalPhrase (new java.lang.String "WITHCREDITCARD"))
> > while
> > executing (assert (ccprep (call ?atask getPrepositionalPhrase (new
> > java.lang.Str
> > ing "WITHCREDITCARD")) (call ?atask getPreferredValue 3))) while executing
> > defru
> > le is-clearpayment-task while executing (run).
> >   Message: Not an external address: "<Fact-1>" (type = FACT_ID).
> >   Program text: ( run )  at line 40.
> >         at jess.Value.typeError(Value.java:373)
> >
> > ***
> >
> > Am I not allowed to "call" from the execution part of a rule? Is there a
> > converter function? Or am I not thinking "Jess thoughts" enough yet?
> >
> > TIA,
> > Ed Meier
> > [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]
> > ---------------------------------------------------------------------
> >
> >
> 
> ---------------------------------------------------------------------
> 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]
> ---------------------------------------------------------------------
> 



---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9012                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
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