Java Strings are immutable. What you did, was reassign the 'local variable'
that contains a reference to the same object that was in application data.
That has no effect on the object that's in the application data. I believe
there's an entry in the FAQ on this.
On 11/18/05, marc ratun <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I tried to extend the HelloWorld example with an ApplicationData Object.
>
> 1) Before launching the algorithm I call:
>
> workingMemory.setApplicationData("contextstr","init");
>
> 2) In the DRL I specified the application-data:
>
> <application-data
> identifier="contextstr">java.lang.String</application-data>
>
> 3) In the consequence tag I changed the value of the String:
>
> <java:consequence>
> helloWorld( hello );
> contextstr = "consequence-hello";
> </java:consequence>
>
> 4) After the algorithm terminates, I read the ApplicationData object
> again:
>
> System.out.println("ctx: " +
> (String)workingMemory.getApplicationData("contextstr")) ;
>
> Unfortunately, it returns:
>
> ctx: init
>
> so the value remains unchanged.
>
> What did I do wrong?
>
> _________________________________________________________________
> Don't just search. Find. Check out the new MSN Search!
> http://search.msn.com/
>
>
--
Geoffrey Wiseman