Sending change notifications using a Workflow
Database Monitor can automatically respond to database changes by either notifying one or more people, or by automatically launching custom programs. This part of Database Monitor is referred to as the Workflow component. For the following example, we will configure Database Monitor to notify a person by email when there has been a change to any record in the file TSTEMP.
To notify users that a file has changed
- In the Database Monitor Configuration - Files panel, enter 20 for TSTEMP. Use 4 to delete the existing "Test Notify" Workflow. For this demonstration we will create a new one.
- Press F6. The Add New Record panel appears.
- For Description, enter "Test Notify" and ensure Active is set to Y.
- Press Enter to create the Workflow.
- Enter 10, Criteria, then press F6 to Create. Here, you define the Criteria for the Workflow (i.e. the fields you would like to report on).
- Enter a 1 for *RECORD. This indicates you want to report whenever a change to any field in the file is made.
- Since we selected *RECORD in the previous step, the options under the "Record level types" heading apply to this Workflow. For this example, we will enter CH to indicate we want to report any change to a record in the file.
- Press Enter twice. The specified Criteria has been added to the Workflow. Now, specify the action to take once this condition (a change to any record in the file) has been met. For this example, we will notify someone by email that the change has been made.
- Press F3 to return to the previous screen (IDT510-01) and enter option 11, Users/Depts, for Test Notify.
- Press F6, Create. An Add New Record panel appears with many options relating to who to alert. Here, you can tell Database Monitor to notify a user by email, and have that user digitally sign to acknowledge the change to the file.
- Press Enter to save and review the recipient(s) who will be notified. Now, when a change is made to the file TSTEMP, a notification email will be sent to all the users/email addresses listed here.
- Press F3 three times to return to the main menu.
- Enter option 17 to open the Database Monitor Manager.
- After Command, replace the existing text with
REFMON
and press Enter. - If you would like to test this Workflow, simply change a record in the file. Press F3 to return to the Main Menu and then press F21 to open the command prompt.
- Enter
UPDDTA DATATHREAD/TSTEMP
. - Press Page Down to display the first record.
- Change one or more of the fields and press Enter. For this example, the Employee Name will be changed.
- Press Enter. The email notification is sent to the defined recipients, including a list of all changes made to the file.
Use the Record Level Criterion panel to specify what kind of action to report on for this Workflow.
To send the email to a user who has already been configured as a Database Monitor user, configure this screen as follows.
To send the email to an external user, you can configure the screen as follows:
Note: See Workflow - Users for more details regarding the options on this screen.
You must refresh the Workflow list in order for Workflow changes to take effect immediately. To do this:
For Workflow changes to take effect immediately, you must run the REFMON command to refresh the Workflow list (otherwise, the Workflow change will take effect later after a periodic routine).
Note: Remember you can display a list of all Database Monitor commands using the command HELP.