- 23 May 2023
-
DarkLight
-
PDF
eventListnerJob
- Updated on 23 May 2023
-
DarkLight
-
PDF
eventListenerJob Task Purpose
The eventListenerJob task is used to pause and wait for an event that matches a specified topic and schema. Job variables can also be used with this task.
Note: This task is for on premise IAP install only.
Potential Use Case
Suppose you have an email queue and it requires all of the relevant information in a form to be filled out. The eventListenerJob could be used to pause the request if the correct information is not present when the request is passed through.
Properties
Input and output parameters are shown below.
Incoming | Type | Required | Description |
---|---|---|---|
job_id |
string | Yes | The job ID. |
source |
string | Yes | The source that provides the topic. |
topic |
string | Yes | The event topic. |
schema |
object | Yes | A valid JSON schema that uniquely identifies an event. |
Outgoing | Type | Description |
---|---|---|
result |
object | The payload of the captured event. |
Example
In this example, the source
string is referring to @itential/app-workflow_engine to pull the job information.
The event topic
is jobPause. The job will complete once it's paused on the Jobs page, where the result
is shown.
The schema
from the source
being listened for is {"type":"object","required":["job"],"properties":{"job":{}}}.
The result
returns information relevant to the workflow, namely the job _id, name, type, and tasks.