System setup for events
Event setup describes creating an event and options for triggering the event.
This section will provide information on the following topics:
- Event overview
- Creating an event
- Configuring events to work with manual triggers
- Configuring event triggers
- Manually triggering an event
Event overview
Event rules instruct the server to watch for certain conditions and to perform certain tasks when they arise.
In order for an event to run, the code triggered by the event must reside on the Longview application server.
Event rules need to be created to define the data area that will be monitored to trigger the event.
For more information on creating event rules, see “Writing Event rule statements for procedures” in the Longview Application Administrator Guide.
For information on rule numbering conventions, see Rule ID Convention.
To run an event, they can either be:
- Triggered manually. This is described in further detail in Configuring events to work with manual triggers.
- Triggered by submitting either a string or a numeric value to the data area defined within the event rule. Only numeric values that result in a delta - that is, a difference in value between the previous and current values - will trigger a rule. Entering a value of “0” to a string will not trigger a rule.
Creating an event
Before you can set up a new event rule, the code for the event rule must exist. The Event template allows you to create, modify or delete event code from the Longview application server.
For more information on creating events, see “Maintaining Events” in the Solutions Developer Guide.
Configuring events to work with manual triggers
Events provide the ability to execute an application framework calculation when data changes in a specified area. This involves the creation of the actual event logic and registering the event via an event rule in Application Administrator. To use the solutions framework manual event triggers requires event rules to be configured in a specific way.
To configure an event for the manual trigger:
- Determine the ID for the event rule to be created.
- Create an account symbol under the EVENT_TRIGGERS parent named EVNT_<ID>.
- Set the symbol type to Standard.
- Set the symbol weight to 0.
- Create a new event rule with the ID determined above. This will be the manual trigger rule. The account symbol will be the one created above.
- Create the data trigger rule(s).
- Increment the ID by 1 for each data triggered event rule.
- Setup event rule merging for the new rules.
- If the new rule has any dependencies with other rules, set these as well.
- In the event logic you can detect if the event was triggered manually with the following (assumes the accounts dimension is named ACCOUNTS):
If StrLeft("$E_ACCOUNTS[1]$", 4) == "EVNT"
- Configure the event trigger to match the symbols defined in the manual event trigger rule. See Configuring event triggers.
Configuring event triggers
Manually triggering an event requires specifying the symbols to trigger the event to execute against. Event Trigger Setup allows you to specify the valid range of symbols for manually triggering an event.
Accessing event trigger setup
- Select the Consolidate module.
- Select the Administration category.
- Expand Calculations.
- Click Events Setup. The events setup dialog appears.
Modifying event trigger restrictions
The default state is no restriction, which will allow a manually triggering an event on any symbol. This may not trigger the actual event as the symbol selected might not be in the range of symbols included in the related event rule.
To limit the symbols for a manual event trigger:
- Select the event to configure and click Next.
- The next dialog appears, allowing you to set the valid range of symbols for the event.
- For each dimension, select the symbol that matches the manually triggered event rule specifications.
- Click OK. The manual event trigger restrictions are saved.
Manually triggering an event
In some cases it is necessary to manually trigger an event, because:
- It previously executed with an error.
- It is a newly created event.
- Data has been submitted without dynamic roll up.
- It is normally manually triggered.
The events trigger app allows you to manually trigger an event.
Accessing manual event trigger
- Select the Consolidate module.
- Select the Administration category.
- Expand Calculations.
- Click Events Trigger. The events trigger dialog appears.
Trigger the event manually
An event can be manually triggered on a subset of its area.
To manually trigger the event:
- Select the event to trigger and click Next.
- The next dialog appears, allowing you to set the range of symbols on which to trigger the event.
- For each dimension, select the symbol to trigger the event on.
- Click OK. The event is triggered.