I need have reference to command object from other place. I use DWR technology and I only have references to request session and spring context. But how can I get access to my command object created in flow action?
Printable View
I need have reference to command object from other place. I use DWR technology and I only have references to request session and spring context. But how can I get access to my command object created in flow action?
If you're using the default HttpSessionFlowExecutionStorage, the FlowExecutions are actually stored in the HttpSession, so if you can get hold of the flow execution id (e.g. from the request), you could do something like this:
ErwinCode:String flowExecutionId=request.getParameter("_flowExecutionId");
FlowExecution flowExecution=(FlowExecution)WebUtils.getRequiredSessionAttribute(request, flowExecutionId);
Event event=new ServletEvent(request, response);
RequestContext context=new StateContextImpl(event, flowExecution);
FormObjectAccessor accessor=new FormObjectAccessor(context);
Object myFormObject=accessor.getFormObject("myFormObject", ScopeType.FLOW);