Workflow Events enable workflows to progress based on events from outside sources. An event system allows workflows to come to a halt until a certain event occurs. When this event occurs the workflow may process the event and progress.
Note: For more on the event system from a developer perspective refer to IAP Event System in the IAP User Guide for more information. This will explain how to define/create events as well as how to define event handlers in code.
Creating a Workflow Event Listener
To create an eventListener
:
Add an
eventListener
task to the workflow canvas. This task type can be found under theWorkFlowEngine
section of the Workflow Builder sidebar.Verify the purple
eventListener
task node is added to the canvas.Double-click the Event Listener task. A New Event Listener dialog will display.
Populate all the
New Event Listener
fields and then click Update.
Field Name | Description |
---|---|
Event Source | The name of the application that will be emitting the event. Note the namespace @killgore in front of helloworld . If this were from the Configuration Manager it would be @itential/app-configuration_manager . The event source matches the pronghorn.json id field. |
Event Topic | The name of the event defined in the "topics" section of the pronghorn.json file. This is the event that will progress the workflow. See the IAP Event System link in the note above for defining events. |
Event Schema Filter | This is a required field that uses JSON schema to define and filter an event when it contains a particular piece of data. For instance, the listener will only respond to a test_pattern event when the name field is "michael". |
Event Schema Filter Example
{
"type": "object",
"required": [ "name" ],
"properties": {
"name": {
"enum": [ "michael" ]
}
}
}
Note: For the New Event Listener dialog that was shown above, the event listener will only progress the workflow if it receives the
test_pattern
event from the@killgore/helloworld
application and the payloadname
field has the value ofmichael
.
Running the Workflow Event Listener
When a job is triggered from a workflow containing one or more Event Listener
tasks, the Event Listener
task for that job will remain in a running
state until it receives the expected external event. The workflow will progress when the external event is received.
Additional details to create a Workflow Event Listener Task for NSO NETCONF streams can be found in the IAP Integrations guide for network adapters.