AX2530
Create event handlers for a job
Create user-defined event handlers in a job to automatically trigger a job run when the event name is called by another feature. Axiom Budget Planning and Performance Reporting supports several features to raise an event:
- RunEvent function and command
- File Group triggers
- Raise Event Scheduler task
Event handlers are defined by name. Multiple jobs can have an event handler with the same name. When that event handler is called, it affects all jobs that contain the event handler with the matching name.
-
In the Scheduler dialog, open a job to edit or create a new job.
-
In the left side of the job, select Event Handlers.
-
On the Job tab of the ribbon, in the Event Handlers group, click Add.
A new event handler is added to the job.
-
Double-click the Event Name field so that the field becomes editable, and then enter the preferred event handler name.
For example, if the event handler is used to trigger Process Plan Files jobs, you could name the event handler ProcessPlanFiles.
This event name is the name that is used in features such as RunEvent to trigger this job run.
- In the Execute As field, select one of the following items to determine the user identity to use to run the job when it is run by the event handler:
Owner: The job is run under the identity of the job owner.
The job owner is the user who last saved the job. If you are not sure of the current job owner, check the Job Variables tab. The current job owner is listed in the System defined values section.
Requester: The job is run with the identity of the user who triggered the event handler.
By default, event handlers are set to run as the Owner. Carefully consider this option as it may affect whether the job can be run and how the job is run.
For example, if the event handler is set to Requester but the user who triggered the job does not have access to the file group specified for a Process Plan Files task, the task fails.
This may be the preferred outcome—you may want the job to be dependent on the user's rights, and therefore, specify Requester. On the other hand, you may want the job to run in the same way every time, regardless of the user that triggers the job. In that case, specify Owner.
By default, the event handler is set to Active, which means it is found by any process that triggers the event handler. If you want to temporarily exclude this job from event handler processing, clear the Active check box.
Associate an event handler with a file group
If a Scheduler job with an active event handler is stored in a file group Utilities folder, the event handler is associated with that file group. When using RunEvent to trigger jobs for runs, you can optionally specify a file group context so that only event handlers associated with that file group (or no file group) are considered.
To store a Scheduler job within a file group, you must first create and save the job within the Scheduler Jobs Library. Then, you can use Axiom Explorer to move the job from the Scheduler Jobs Library to the file group Utilities folder. If the file group and its utilities are later cloned using any process—such as regular file group cloning, scenario creation, or file group rollover—the event handler is also cloned and is associated with the new file group.
Delete an event handler
If you no longer need an event handler, delete it from the job. Select the event handler and then click Remove Selected. You can also click Clear All to remove all event handlers from the job.
User-defined event handlers appear along with the system event handlers in the Event Handlers tab (Service > Event Handlers). If you right-click a user-defined event handler in this location and select Remove event handler, it does not delete the event handler from any jobs that use it but it does set the event handler to inactive.
