AnsweredAssumed Answered

EL: Invoking methods using parameters and el version clashes

Question asked by frederikheremans1 on Oct 1, 2010
Latest reply on Oct 7, 2010 by iravanchi
A very powerful feature of the EL 2.1.2 spec (part of Java EE6) is the possibility of invoking method calls with parameters. No doubt, this would be a great feature to have for developers to use in their process definitions.

For example, take assignment listeners (soon to be implemented by Joram). It would allow developers to use a method as assignment Listener. This way, he/she can pass execution variables into methods on existing (spring)beans, instead of forcing the developer to implement a one-liner Listener class that does the except same thing. This way, no hard link is explicitly needed to activity from the existing spring-beans, since we can just pass simple native java types (more loosely coupled).

JUEL 2.2.1 provides an implementation for the 2.1.2 spec. Unfortunately, we can't just use JUEL since the EL-version clashes with older 1.0. Therefore I suggest the following solution:

* Since JUEL is apache-licensed, we can modify and extend the source-code, of course complying to the http://www.apache.org/licenses/LICENSE-2.0.

* Refactoring the juel-api classes and rename all javax.el to another package-name so it doesn't collide with the javax.el. The juel-impl classes will now be detached from javax.el and would work in any environment.

* Since we use ActivitiExpression in activiti, a layer between the engine and the expression implementation, the switch from javax.el.ValueExpressions to our own will be transparent.

* We can add a mechanism that can, when running in EL 2.1.2 environment, eg. Tomcat 7 or glassfish EE6, switch to the default EL-strategy (using javax.el.ExpressionManagerFactory)  and use the environement/container provided 2.1.2 EL-implementation.

* We will build the modified JUEL as separate project (eg. activiti-juel or activiti-el) and add this as a dependency to activiti-engine, replacing JUEL-impl  dependency.

Any thoughts, remarks or suggestions are welcome!

Outcomes