@@ -66,6 +69,11 @@ public class ErrorPropagation {
}else{
LOG.info("{} throws error event with errorCode '{}', but no catching boundary event was defined. Execution will simply be ended (none end event semantics).",
<para>The snippet below adds 2 listeners to a process-definition. The first listener will receive events of any type, with a listener implementation based on a fully-qualified class name.
The second listener is only notified when a job is successfully executed or when it failed, using a listener that has been defined in the <literal>beans</literal> property of the process engine configuration.</para>
<para>For events related to entities, it's also possible to add listeners to a process-definition that get only notified when enitity-events occur for a certain
entity type. The snippet below shows how this can be achieved. It can be used along for ALL entity-events (first example) or for specific event types only (second example).</para>
<para>For events related to entities, it's also possible to add listeners to a process-definition that get notified only enitity-events occur for a certain
entity type. The snippet below shows how this can be done. It can be used along for ALL entity-events (first example) or for specific event types only (second example).</para>
<para>Another way of handling events being dispatched is to throw a BPMN event. Please bare in mind that it only makes sense to throw BPMN-events with certain kinds of
activiti event types. For example, throwing a BPMN event when the process-instance is deleted will result in an error. The snippet below shows how to throw a signal inside process-instance, throw a signal to an external
process (global), throw a message-event inside the process-instance and throw an error-event inside the process-instance. Instead of using the <literal>class</literal> or <literal>delegateExpression</literal>,
the attribute <literal>throwEvent</literal> is used, along with an additional attribute, specific to the type of event being thrown.</para>
<para>If additional logic is needed to decide wether or not to throw the BPMN-event, it's possible to extend the listener-classes provided by Activiti. By overriding the <literal>isValidEvent(ActivitiEvent event)</literal>
in your subclass, BPMN-event throwing can be prevented. The classes involved are <literal>org.activiti.engine.test.api.event.SignalThrowingEventListenerTest</literal>, <literal>org.activiti.engine.impl.bpmn.helper.MessageThrowingEventListener</literal> and <literal>org.activiti.engine.impl.bpmn.helper.ErrorThrowingEventListener</literal>.</para>
</section>
<section>
<title>Notes on listeners on a process-definition</title>
When an illegal event-type is used in the <literal>events</literal> attribute, an exception will be thrown when the process-definition is deployed (effectievly failing the deployment). When an illegal value for <literal>class</literal> or <literal>delegateExecution</literal> is supplied (either unexisting class, unexisting bean referenced or delegate not implementing listener interface), an exception will
When an illegal event-type is used in the <literal>events</literal> attribute or illegal <literal>throwEvent</literal> value is used, an exception will be thrown when the process-definition is deployed (effectievly failing the deployment). When an illegal value for <literal>class</literal> or <literal>delegateExecution</literal> is supplied (either unexisting class, unexisting bean referenced or delegate not implementing listener interface), an exception will
be thrown when the process is started (or when the first valid event for that process-definition is dispatched to the listener). Make sure the referenced classes are on the classpath and that the expressions resolve to a valid instance.
<entry>An uncaught BPMN error has been thrown. The process did not have any handlers for that specific error. The event's <literal>activityId</literal> will be empty.</entry>