Utilities for workflow

Back: Functional utilities of the application

Workflow utilities are designed to automate certain actions when the state of a workflow changes. The utility connects to the application in deploy.json in the global.plugins object, for example:

The wfEvents utility is connected here. The script containing the description of actions when changing the state of the workflow is located on the path applications/sakh-pm/lib/wfEvents.js.
In the options field, any variables and their values can be indicated, that will become available in the script through the fields of the object passed as an argument to the main function of the module.

The script is compiled in module format, provided that it must include the init method, for example:

This script describes the actions that need to be performed when changing the state of the assignmentBasic@sakh-pm workflow to fin, and the proposal@sakh-pm workflow to cancel.