I think that a possible solution could be the following

val.factValue(context).getDeftemplate().getShadowClassName()

and then instantiate a new instance starting from the string that the above
method returns... 

In any case, I'd like to know your opinion...



Marco Zappatore wrote:
> 
> Dear Jess users,
> I have a rule "myrule" that fires whenever two facts with specific slot
> contents are found within the working memory.
> These facts are shadow facts.
> Then I have a java user function "myUserFunction" that passes those two
> facts (using their pointers, let's say ?f1 and ?f2) to a Java program.
> My question is: is it possible to get those facts and instantiate them
> again in Java?
> In other words the procedure is:
> 1) define a java bean
> 2) assert shadow facts from that java bean with different slot contents
> each time
> 3) find a given fact with a given content using a proper rule
> 4) pass the fact to a java program
> 5) create a new instance of the java bean with the content just retrieved
> 
> the problem resides at point n°5 because actually I'm using
> Value val = vv.get(1).resolveValue(context);
> Using val.factValue(context)) I can verify that the content is correct but
> how can I use val to instantiate a new Java Bean?
> 
> Any help is appreciated, thanks in advance.
> 
>  Marco Zappatore
> 

-- 
View this message in context: 
http://old.nabble.com/Retrieve-facts-from-Jess-and-re-instantiate-them-in-Java-tp26160053p26160091.html
Sent from the Jess mailing list archive at Nabble.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].
--------------------------------------------------------------------

Reply via email to