Events and event-triggered schedules in Microstrategy
Subscriptions and tasks that are based on event-triggered schedules execute when a MicroStrategy event is triggered. These triggers do not need to be defined in advance. A system external to Intelligence Server is responsible for determining whether the conditions for triggering an event are met.
Once Intelligence Server has been notified that the event has taken place, Intelligence Server performs the tasks associated with the corresponding schedule.
In a clustered environment, administrative tasks associated with event-triggered schedules are executed only by the node on which the event is triggered. MicroStrategy recommends that you use event-triggered schedules in situations where it is important to control which node performs certain tasks.
If projects are distributed asymmetrically across the cluster, when you assign an event-triggered schedule to a project, make sure you trigger the event on all nodes on which that project is loaded.
Creating events
You can create events in Developer using the Event Manager.
To create an event in Developer
- In Developer, log in to a project source. You must log in as a user with the Create And Edit Schedules And Events privilege.
- Go to Administration > Configuration Managers > Events. The list of events for the project source displays on the right-hand side.
- Select File > New > Event.
- Name the new event.
To create an event using Command Manager
You can create events with the following Command Manager script:
CREATE EVENT event_name [DESCRIPTION description];
By default, this script is in the folder
C:\Program Files\ MicroStrategy\Command Manager\Outlines\
.Triggering events
MicroStrategy Command Manager can trigger events from the Windows command line. By executing Command Manager scripts, external systems can trigger events and cause the associated tasks to be run.
For example, you want to execute several reports immediately after a database load occurs so that these reports always have a valid cache available. You create an event called OnDBLoad and associate it with an event-triggered schedule. You then subscribe those reports to that schedule.
At the end of the database load routine, you include a statement to add a line to a database table, DB_LOAD_COMPLETE, that indicates that the database load is complete. You then create a database trigger that checks to see when the DB_LOAD_COMPLETE table is updated, and then executes a Command Manager script. That script contains the following line:
TRIGGER EVENT "OnDBLoad";
When the script is executed, the OnDBLoad event is triggered, and the schedule is executed.
You can also use the MicroStrategy SDK to develop an application that triggers an event. You can then cause the database trigger to execute this application.
Triggering events manually
You can manually trigger events using the Event Manager. This is primarily useful in a testing environment. In a production system, it may not be practical for the administrator to be present to trigger event-based schedules.
To trigger an event manually
- In Developer, log in to a project source. You must log in as a user with the Trigger Event privilege.
- Go to Administration > Configuration Managers > Events.
- Right-click an event and select Trigger.
Comments
Post a Comment