context does not preserve variable when invoked from GroovyUtil.runScriptAtLocation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

context does not preserve variable when invoked from GroovyUtil.runScriptAtLocation

Patrick-4
Please help, I'm super stuck.

In the file EmailServices.java:
The function sendMailFromScreen has an orderId in bodyParameters.
Context is passed to runScriptAtLocation in GroovyUtil.java.  The
orderId is available here.  :)
The function runScriptAtLocation calls this groovy file, MiniReorderProds.groovy
MiniReorderProds.groovy doesn't have the orderId in the context.  :(

I got the impression that this line preserved the context
InvokerHelper.createScript(scriptClass, getBinding(context)).run();
//in file GroovyUtil.java
But it doesn't seem to.  Thanks in advance.
Patrick
Reply | Threaded
Open this post in threaded view
|

Re: context does not preserve variable when invoked from GroovyUtil.runScriptAtLocation

Scott Gray-2
Hi Patrick,

Just a blind guess but have you tried getting the orderId from within bodyParameters?
i.e. orderId = bodyParameters.orderId
Sorry if that is exactly what you are doing.

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 8/03/2010, at 9:28 PM, Patrick wrote:

> Please help, I'm super stuck.
>
> In the file EmailServices.java:
> The function sendMailFromScreen has an orderId in bodyParameters.
> Context is passed to runScriptAtLocation in GroovyUtil.java.  The
> orderId is available here.  :)
> The function runScriptAtLocation calls this groovy file, MiniReorderProds.groovy
> MiniReorderProds.groovy doesn't have the orderId in the context.  :(
>
> I got the impression that this line preserved the context
> InvokerHelper.createScript(scriptClass, getBinding(context)).run();
> //in file GroovyUtil.java
> But it doesn't seem to.  Thanks in advance.
> Patrick


smime.p7s (3K) Download Attachment