This content has been marked as final.
Show 2 replies
-
1. Re: Access field of an Object in a Controller variable
kukeltje May 29, 2008 9:13 AM (in response to beve)Is it possbile to access a field of an object in the name attribute field like shown above?
No, the variable 'name' attribute is a string 'id' and not an object. The way you do it, you should have persisted a variable with the name "entireCustomerAsObject.firstName" -
2. Re: Access field of an Object in a Controller variable
beve May 29, 2008 11:23 AM (in response to beve)Ah, ok thanks!
Just thinking about this...would it be possible to use an expression language like MVEL to support thes kind of access that I was on about?
Something similar to this (ContextInstance):public Object getVariable(String name, Token token) { Object variable = null; TokenVariableMap tokenVariableMap = getTokenVariableMap(token); if (tokenVariableMap != null) { try { variable = MVEL.eval( name, tokenVariableMap.getVariablesLocally()); } catch( Exception e ) { variable = tokenVariableMap.getVariable(name); } } return variable; }
Regards,
/Daniel