Event State
name
Unique State name
string
yes
type
State type
string
yes
exclusive
If true
, consuming one of the defined events causes its associated actions to be performed. If false
, all of the defined events must be consumed in order for actions to be performed. Default is true
boolean
no
onEvents
Define the events to be consumed and optional actions to be performed
array
yes
timeouts
State specific timeout settings
object
no
stateDataFilter
State data filter definition
object
no
transition
Next transition of the workflow after all the actions have been performed
string or object
yes (if end
is not defined)
onErrors
States error handling definitions
array
no
end
Is this state an end state
boolean or object
yes (if transition
is not defined)
compensatedBy
Unique name of a workflow state which is responsible for compensation of this state
string
no
metadata
Metadata information
object
no
Example:
Event states await one or more events and perform actions when they are received. If defined as the workflow starting state, the event state definition controls when the workflow instances should be created.
The exclusive
property determines if the state should wait for any of the defined events in the onEvents
array, or if all defined events must be present for their associated actions to be performed.
Following two figures illustrate the exclusive
property:
If the Event state in this case is a workflow starting state, the occurrence of any of the defined events would start a new workflow instance.
If the Event state in this case is a workflow starting state, the occurrence of all defined events would start a new workflow instance.
In order to consider only events that are related to each other, we need to set the correlation
property in the workflow events definitions. This allows us to set up event correlation rules against the events extension context attributes.
If the Event state is not a workflow starting state, the timeout
property can be used to define the time duration from the invocation of the event state. If the defined event, or events have not been received during this time, the state should transition to the next state or can end the workflow execution (if it is an end state).
The timeouts
property can be used to define state specific timeout settings. Event states can define the stateExecTimeout
, actionExecTimeout
, and eventTimeout
properties. For more information about Event state specific event timeout settings reference this section. For more information about workflow timeouts reference the Workflow Timeouts section.
Note that transition
and end
properties are mutually exclusive, meaning that you cannot define both of them at the same time.
Last updated