Adam Heath wrote:
Adrian Crum wrote:
On a related note...
The problem Adam tried to fix is one of the problems I have with how the
scripting language is used. Here are some examples:
<set field="someField" value="${someMap.someElement}"/>
<set field="someField" from-field="someMap.someElement"/>
Both of those set elements do the same thing. The first example is (in
my opinion) a hack - it should throw an exception. The value attribute
should contain a constant value - not an expression.
The specific problem Adam tried to fix was:
<set field="someField" value="${groovy:...}"/>
Again, I believe that use of the set element should throw an exception.
David suggested adding an attribute to the script element that would
accept scriptlets (or script fragments). My suggestion is to add a third
choice to the set element: expression. So, the set element would look
like this:
<set field="someField" expression="${groovy:...}"/>
To summarize, a field value can be assigned from a constant value, or
from an existing field, or from an expression. Attempts to hack an
attribute to make it behave like one of the others results in an exception.
That's my two cents.
I'm still investigating this...
I know. I guess the point I'm trying to make is, you wouldn't have had
to make this change if mini-language was more strict.