AX2193
Defining triggers for a file group
You can define one or more triggers for a file group, to automatically execute Scheduler jobs after data is saved from plan files in the file group.
This section explains how to define triggers for a file group. In order for a trigger to perform any actions, the trigger must be enabled and one or more corresponding Scheduler jobs must have been set up for use with that trigger. For more information, see Setting up a Scheduler job for use with triggers.
Optionally, you can also set up file group-specific email notification addresses, to be used within the triggered Scheduler jobs. For more information, see Using email notifications with triggers.
Triggers are defined on the Triggers tab of the Edit File Group dialog. To open this dialog:
-
On the Axiom tab, in the Administration group, click Manage > File Groups.
The Axiom Explorer dialog opens, with the focus on the File Groups folder.
- Navigate to the file group that you want to edit, then right-click the file group and select Edit.
Adding a trigger to a file group
-
At the bottom of the Triggers tab, click Add Event.
A new trigger event is added to the Triggers tab.
TIP: You can also add an event by right-clicking in the tab.
-
Double-click inside the Event Name column so that an editable text box appears, and then type the desired name of the trigger event.
This event name is what links the trigger to the Scheduler jobs to be automatically executed. Each Scheduler job that you want to be triggered must contain an event handler with the same name as the trigger event.
-
Optional. In the Variables column, create one or more variables for the trigger.
- To add a variable, click Add Variable. (You can also add a variable by right-clicking the Variable Name header.)
- To delete a variable, right-click the variable and then select Remove Variable.
Each variable must have a defined name, and then must be associated with a column in the plan code table or a fixed value. For more information, see Using variables with triggers.
-
By default, the Enabled check box is selected for the trigger event. If you are not yet ready to enable the trigger, clear the check box.
If the trigger is enabled, no errors will occur if no matching Scheduler jobs are found—it simply means that no action will be taken as the result of the trigger.
-
Click OK to save.
Editing a trigger in a file group
On the Triggers tab, you can edit any existing trigger setting. Keep in mind the following:
- If you disable a trigger, then that trigger will no longer be evaluated for the file group. Generally, this should be used to temporarily disable trigger processing. If you no longer need the trigger at all, you can delete it.
- If you enable a trigger, then that trigger will be active as soon as the file group settings are saved. You should be sure that the corresponding Scheduler jobs are finalized before enabling a trigger. No errors will occur if no matching Scheduler jobs are found—it simply means that no action will be taken as the result of the trigger.
- If you change the name of an event or a variable, you must also change the corresponding event handler name or variable name in any Scheduler jobs that are already set up for use with the trigger.
To edit an event name, variable name, or variable value, double-click the name. The name becomes editable, and you can type your changes directly in the grid. To delete a variable within a trigger, right-click the item and then click Remove.
Deleting a trigger in a file group
On the Triggers tab, you can delete a trigger event if it is no longer needed. Select the trigger in the list, then right click and select Remove Event.
You can define one or more variables for use with triggers. These variables can be used in the triggered Scheduler jobs to impact the job execution in some way.
For each variable, you define the following:
Item | Description |
---|---|
Variable Name |
The name of the variable. To use the variable in the triggered Scheduler job, create a corresponding job variable with the same name and then use the variable in the desired task settings. Each variable must be associated with one of the following:
|
Column |
Select a column in the plan code table that contains the values for the variable. For example, you can select DEPT if you want to pass department numbers to the Scheduler job, or Region if you want to pass region names. If multiple plan codes are evaluated for the trigger as a result of a Process Plan Files utility, then multiple column values will be returned as a comma-separated list. |
Value |
If you are not using a column, then enter a fixed value for the variable. Multiple values can be entered as a comma-separated list. NOTE: Axiom Software passes the value to the Scheduler job in the same format as it appears here. If the value is to be used in a filter, you must place single quotation marks around it as appropriate. |
For example, you might create a variable named Region, which uses the column Region in the DEPT table. Imagine that as part of a Process Plan Files utility, 10 different plan codes save changed data to the database and therefore trigger a Scheduler job to be executed. If 7 of those plan codes belong to the North region and 3 of them belong to the South region, then the following variable value will be passed to the Scheduler job: 'North','South'
.
NOTE: The above example assumes that all of the plan codes are associated with the same email notification address (or that the optional notification address settings are not being used). If the plan codes were associated with different addresses, then a separate Scheduler job would be created for each unique address, and the variable values would be limited to the plan codes associated with each address.
For more information on how you might use a variable value in a Scheduler job, see Setting up a Scheduler job for use with triggers.