Re: JESS: Is it possible to bind a Java object directly to a Jess variable without creating a new object?

2011-11-07 Thread Donald Paul Winston
Use shadow facts. see http://www.jessrules.com/jesswiki/view?FactsVsShadowFacts On Nov 4, 2011, at 1:08 PM, Hunter McMillen wrote: Hi everyone, I am trying to assert to Jess that an object exists when I encounter a new object in my Java program. Right now I am using a template to mirror

Re: JESS: Is it possible to bind a Java object directly to a Jess variable without creating a new object?

2011-11-07 Thread Hunter McMillen
Thanks for your quick reply. After I manage to get my Java object into Jess, can I assert it as a fact? Then have rules lhs match on the existence of some object with attributes x, y, and z? Hunter On Fri, Nov 4, 2011 at 4:01 PM, Friedman-Hill, Ernest ejfr...@sandia.govwrote: ** There are

RE: JESS: Is it possible to bind a Java object directly to a Jess variable without creating a new object?

2011-11-07 Thread Friedman-Hill, Ernest
That's what Rete.add() and Rete.definstance() do. If that's the goal, all of this other stuff is superfluous -- just call add() or definstance() from Java. From: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] On Behalf Of Hunter McMillen Sent:

Re: JESS: Is it possible to bind a Java object directly to a Jess variable without creating a new object?

2011-11-07 Thread Wolfgang Laun
I daresay, not all of us use the same terms for the same things ;-) I'll use Pojo for a Java object; it contains data in named fields. I'll use Fact for an entitiy that has been inserted into Jess' Working Memory; it contains data in named slots. And then, there is a shadow fact, which is a fact

RE: JESS: Is it possible to bind a Java object directly to a Jess variable without creating a new object?

2011-11-04 Thread Friedman-Hill, Ernest
There are (obviously) two options: (a) put the object somewhere accessible, and run Jess code that retrieves it, or (b) use Jess's Java API to set a Jess variable to contain the object. Either would work. The store/fetch mechanism is sort of an built-in easy way to do (a). Alternatively, say