When defining steps for a workflow each step has an OnSuccess and an OnFailure event with an associated action. emdash supports three out of the box actions:
- FailJob - the job will fail if this step succeeds/fails
- ContinueJob - the job will continue to the next step in the workflow if this step succeeds/fails
- CompleteJob - the job will complete if this step succeeds/fails even if further steps exist in the workflow.
Users are also able to create custom event actions that are linked to a custom step as well as one of the out of the box actions. To create a custom event action clikc the Custom step actions button on the Workflows page:
This will display the Custom Step Actions list page - to create a new custom step action click the Add action button:
The create Custom event action page is dispalyed:
Enter a name for the action and select a step to call when the action is triggred. This is a PowerShell step loaded into emdash that must take only a single $ctx parameter. The drop down list will only display steps athat follow this single parameter convention.
Select a Default action to perform - this shows the out of the box emdash actions and is the action that will be performed once the custom step has been executed.
Uses for custom step actions include logging errors in a custom way e.g. alerting via email. It is best not to invoke complex business logic in custom step actions but to restrict operations to relatively simple logging.
Click the Save button and the custom step action is saved to the emdash database and is then available to be used when defining workflows.
Custom step actions can also be edited by using the edit icon in the grid:
0 Comments