Events and Event-Triggered Schedules
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.
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 Configuration Manager -> Events.
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.
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";
Trigger Event statement
Triggers an event in a MicroStrategy Intelligence Server.
TRIGGER EVENT event_name;
where:
event_name is the name of the event to be triggered, of type string, between double quotes (" ").
Example
TRIGGER
EVENT "My Daily Report";
When the script is executed, the OnDBLoad event is triggered, and the schedule is executed.
MicroStrategy SDK can also be used to develop an application that triggers an event. You can then cause the database trigger to execute this application.
Comments
Post a Comment