sendAlertsToWorkflow
A Workflow Engine function that sends Situation alerts to a named workflow within a named Inform based workflow engine using the MoogdbV2 sendToWorkflow
API call. Returns true when all the alerts are sent successfully to the target workflow. Returns false if one or more alerts fails to send.
You can specify unique alerts. See the getSituationAlertIds
MoogDb V2 API call for details: getSituationAlertIds.
You can optionally provide a context for the target workflow. This context is available to the target workflow in the workflowContext.
This function is available as a feature of the Add-ons v2.1 download and later. See Install Moogsoft Add-ons for information on how to upgrade.
This function is available for Situation workflows only.
Back to Workflow Engine Functions Reference.
Arguments
Workflow Engine function sendAlertsToWorkflow
takes the following arguments:
Name | Required | Type | Description |
---|---|---|---|
| yes | string | The name of the target inform based engine. |
| yes | string | The name of the workflow within the target inform engine. |
| no | string (true|false) | This argument should be used if you want to send only alerts unique to this Situation. Otherwise sends all alerts. |
| no | object | A JSON object ({…}) containing the context you want passed into the target workflow’s workflowContext. By default the triggering situation id is passed within the context. |
Example
When a Situation first has a severity of “Critical”, send all the contained alerts to the “Alert Inform Engine” and execute a workflow named “Export Alerts”. Pass the situation description and severity to the target workflow. The context parameter can use the substitution macro syntax to populate details about the triggering situation.
engineName : "Alert Inform Engine"
workflowName : "Export Alerts"
uniqueOnly : false
context : { “description” : “$(description)” , “severity” : “$EXPAND(internal_priority)” }
The UI translates your settings to the following JSON:
{"engineName":"Alert Inform Engine","workflowName":"Export Alerts","uniqueOnly":"false","context":{"severity":"$EXPAND(internal_priority)","description":"$(description)"}}