the EE6 specification</ulink> for detailed information). To support all features of latest UEL spec on ALL environements, we use a modified version of JUEL.
</para>
<para>
Expressions can be used in for example <linklinkend="bpmnJavaServiceTaskXML">Java Service tasks</link>, <linklinkend="eventListeners">Event Listeners</link> and <linklinkend="conditionalSequenceFlowXml">Conditional sequence flows</link>.
Expressions can be used in for example <linklinkend="bpmnJavaServiceTaskXML">Java Service tasks</link>, <linklinkend="executionListeners">Event Listeners</link> and <linklinkend="conditionalSequenceFlowXml">Conditional sequence flows</link>.
Although there are 2 types of expressions, value-expression and method-expression, activiti makes abstraction of this and they can both be used where an <literal>expression</literal> is needed.
Note that these expressions support resolving primitives (incl. comparing them), beans, lists, arrays and maps.
</para>
<para>
For more concrete usage and examples, check out <linklinkend="springExpressions">Expressions in Spring</link>, <linklinkend="bpmnJavaServiceTaskXML">Java Service tasks</link>, <linklinkend="eventListeners">Event Listeners</link> or <linklinkend="conditionalSequenceFlowXml">Conditional sequence flows</link>.
For more concrete usage and examples, check out <linklinkend="springExpressions">Expressions in Spring</link>, <linklinkend="bpmnJavaServiceTaskXML">Java Service tasks</link>, <linklinkend="executionListeners">Event Listeners</link> or <linklinkend="conditionalSequenceFlowXml">Conditional sequence flows</link>.
@@ -1686,22 +1686,23 @@ public class ReverseStringsFieldInjected implements JavaDelegation {
<sectionid="eventListeners">
<title>Event listeners</title>
<para>Event listeners allow you to execute external Java code or evaluate an expression when certain events occur. The events that can be captured are:
<itemizedlist>
<listitem><para>Start and ending of a process instance.</para></listitem>
<listitem><para>Taking a transition.</para></listitem>
<listitem><para>Start and ending of an activity.</para></listitem>
</itemizedlist>
</para>
<para>
The following process definition contains 3 event-listeners:
@@ -1728,50 +1729,52 @@ public class ReverseStringsFieldInjected implements JavaDelegation {
</process></programlisting>
</para>
<para>The first event-listener is notified when the process starts. The listener is an external Java-class (like <literal>ExampleEventListenerOne</literal>)
and should implement <literal>org.activiti.engine.delegate.JavaDelegation</literal>. When the event occurs (in this case <literal>end</literal> event)
the method <literal>notify(EventListenerExecution execution)</literal> is called.
<para>The first execution listener is notified when the process starts. The listener is an external Java-class (like <literal>ExampleExecutionListenerOne</literal>)
and should implement <literal>org.activiti.engine.impl.pvm.delegate.ExecutionListener</literal>. When the event occurs (in this case <literal>end</literal> event)
the method <literal>notify(ExecutionListenerExecution execution)</literal> is called.
<programlisting>
public class ExampleEventListenerOne implements <emphasisrole="bold">JavaDelegation</emphasis> {
public class ExampleExecutionListenerOne implements <emphasisrole="bold">ExecutionListener</emphasis> {
It is also possible to use a delegation class that implements the <literal>org.activiti.engine.delegate.JavaDelegation</literal>
interface. These delegation classes can then be reused in other constructs, such as a delegation for a serviceTask.
</para>
<para>
The second event-listener is called when the transition is taken. Note that the <literal>listener</literal> element doesn't define an
<literal>eventName</literal>, since only <literal>take</literal> events are fired on transitions.
<emphasisrole="bold">Values in the <literal>eventName</literal> attribute are ignored when a listener is defined on a transition.</emphasis>
The second execution listener is called when the transition is taken. Note that the <literal>listener</literal> element doesn't define an
<literal>event</literal>, since only <literal>take</literal> events are fired on transitions.
<emphasisrole="bold">Values in the <literal>event</literal> attribute are ignored when a listener is defined on a transition.</emphasis>
</para>
<para>
The last eventlistener is called when activity <literal>secondTask</literal> ends. Instead of using the <literal>class</literal> on the listener declaration,
The last execution listener is called when activity <literal>secondTask</literal> ends. Instead of using the <literal>class</literal> on the listener declaration,
a <literal>expression</literal> is defined instead which is evaluated/invoked when the event is fired.
As with other expressions, execution variables are resolved and can be used. Because the execution implementation object has a property that exposes the event name, it's
possible to pass the event-name to your methods using <literal>execution.eventName</literal>.
</para>
<sectionid="eventListenerFieldInjection">
<sectionid="executionListenerFieldInjection">
<title>Field injection on event listeners</title>
<para>
When using an eventlistener that is configured with the <literal>class</literal> attribute, field injection can be applied. This is exactly the same
When using an executionListener that is configured with the <literal>class</literal> attribute, field injection can be applied. This is exactly the same
mechanism as used <linklinkend="serviceTaskFieldInjection">Service task field injection</link>, which contains an overview of the possibilities provided by field injection.
</para>
<para>
The fragment below shows a simple example process with an event-listener with fields injected.
The fragment below shows a simple example process with an execution listener with fields injected.
The class <literal>ExampleFieldInjectedEventListener</literal> concatenates the 2 injected fields (one fixed an the other dynamic) and stores this in the process variable '<literal>var</literal>'.
The class <literal>ExampleFieldInjectedExecutionListener</literal> concatenates the 2 injected fields (one fixed an the other dynamic) and stores this in the process variable '<literal>var</literal>'.