Event Handlers

Event handlers are activity sequences that are triggered by a specific event. They allow a workflow to run logic when the events occur while the form is active.

Two types of events can be selected for a form event handler. One is a form event, which is part of the selected form. The other is a workflow event, which is available from External Events or the Create Event activity.

When a workflow is running, only one event handler can run at a time; event handlers cannot run parallel. The events are held in a queue until another event handler finishes running. A limit of 10 event handlers can be queued during run time. If an event handler faults, the Form activity also faults.

An event handler can also update, as well as write to, input properties of a Form activity. Form authors can specify whether a form input property can be updated inside the form event handler. If these properties cannot be updated, they will not be available to use in a bind. If you use these properties in an expression, you cannot change the values.

Limits

A Form activity has a limit of 25 event handlers, and 15 events that can be defined by a form.

Event Source

The event source is the name of the resource used as the source of the event. Event properties are then generated for the event handler based on this source.

Event Handlers in Dynamic Forms

A Form activity used in a workflow can either be configured to use a regular, hard-coded form, or it can be dynamic, where the form shown is determined at run time.

An event handler can be added for a dynamic form and it acts identically to an event handler that is added for a regular form. For a dynamic form, however, the events defined on the template must be equivalent to those on the run-time form (display names must match); otherwise, the handlers will not run.

Completed Event Handlers

This section allows you to select how you want your form to behave when this event handler completes. You can choose whether the form submits or cancel automatically.

AttributeValueDescription
SubmitUser-definedIf set to True, the form submits when the event handler completes. If set to False, the form remains active when the event handler completes.
CancelUser-definedIf set to True, the form cancels when the event completes. If set to False, the form remains active when the event handler completes.

Task Step Behavior

This Boolean property determines if the task step is acquired when the event occurs.
AttributeValueDescription
AcquireDefault=True; User-definedIf set to True, the containing task step will be acquired by the client that raised the event. If set to False, the task step is not automatically acquired by the user during run time.

Event Properties

Event properties are generated for the event handler based on the selected event source. The following table describes the common event properties related to an event source.

AttributeData TypeDescription
DescriptionStringSpecifies additional information related to the event definition resource.
EventNodeAddressEventAddressSpecifies the Directory Address of the event that occurred.
IDGUIDSpecifies the unique key that identifies the event definition in the data model.
KeepArchiveBooleanSpecifies whether the event associated with the workflow schedule is maintained in history by the event manager.
NameString

Specifies a display name for the selected property.

TimestampDateTimeSpecifies the actual UTC time that the event occurred.