Creating events
You can use event templates to build event-based calculations. When creating an event through an event template, all procedures, models, data areas and data table definitions will be saved within a kar file on the Longview application server.
- The name of the kar file created will have the same name as the name provided for the event itself.
- The kar file will be placed in the Longview application server’s ‘Events’ folder. For example: Longview\DataServers\<LID>\applications\Events.
- The kar file will contain the calling procedure named <EventName>\Event.lvpro; where <EventName> is the name provided for the event itself.
- An event rule would need to be created to run the event. The event rule syntax would need to be set to run <EventName>\Event.lvpro.
Example
KLX(EVNT_6000100,Actual_Open###,ENTITIES_ALL###,DATAVIEWS_Default,SCENARIOS_Actual###,CURRENCIES_Default)=RUNPROC("applications\Events\SampleEvent\Event.lvpro")
Specifying the manual trigger override
Use Manual Trigger Override to specify any commands to run if the event is triggered manually. The manual trigger override is typically used to set any E_<DIMNAME> variables where the symbol to be calculated in the event is different than the symbol set up in the manual trigger event rule.
For example, for a Longview Close system, normally a manual trigger event rule is set to use CURRENCIES_Default as the currencies symbol. However, the calculation itself is normally performed on all currencies. The default code block in the manual trigger override sets the E_CURRENCIES variable to all currencies.
For a Longview Tax system, normally the Load Parameters procedure is to retrieve all the parameters required for a manually triggered event. The E_ENTITIES variable is also normally filtered to remove the DIM2SET entity symbol from the list of entities.
Specifying the additional KAR files
Additional KAR files can be included in your event by adding them within the additional KAR files section of the template. Once the KAR files are included, any documents within the KAR file can be executed, such as procedures or models.
Normally, additional KAR files are used to create common logic that can be shared among multiple events.
To specify additional KAR files:
- Right click on Additional KAR files and click Add KAR file.
- For the KAR file name, enter the name of the kar file. For example, Sample.kar
Note: The default path for the KAR file is under the Longview Data Server applications directory. If a different path is required, the path must be included in the KAR file name. For example, Libraries\Sample.kar.
- The Root Path is the path that is virtually prepended to all files in the .kar. This is optional and can be left blank.
Specifying the main procedure
The Main Procedure is the controlling procedure that is run when the event is triggered. Use the main procedure to configure your event. You can use the template document “Template_Event_Main” to provide a framework for your main event procedure.
If you are creating a persistent event, you may want to make use of the LVS_EVENTINITIALIZE, LVS_EVENTSHUTDOWN and LVS_PERSISTENT system variables to improve the efficiency and speed of your events. You can use the template document “Template_Event_Persistent” to provide a framework for using these system variables in your code.
For more information on persistent event variables, see “Working with system variables for persistent event rules” in the Longview Developer’s Guide.
Specify the data area definition
Use Data Area Definition to specify the data area to be queried for the export. Open the data area definition to specify its properties.
Note: The name of the data area definition is Main.lvdsp and the name of the data area created using it is daMain.
- In the Options table, complete the following fields:
Field Notes Data type
Specify the data to be queried using one of the following options:
- ADJUSTED—Indicates that data queries include adjustments made via journal entries
- UNADJUSTED—Indicates that data queries exclude adjustments made via journal entries
Default is ADJUSTED.
Download type
Specify the type of data to be downloaded using one of the following options (download option specific in brackets):
- All data—Indicates that all data within the data area definition is downloaded (STANDARDALL).
- Exclude parent values—Indicates that parent data is excluded in the download (STANDARDLEAFONLY)
- Exclude parent and calculated values—Indicates that only leaf data that was submitted to the database via import, input or event calculation is included in the download (LEAFDATA).
Default is All data.
- In the name field, enter the name of your Data Area Definition
- In the Data Area table, complete the following fields for each dimension:
Note: The Spec and Level fields are not applicable if a symbol contains a variable.
Field Notes
Symbols
Type a symbol name. Alternatively, you can use the symbol selector.
To add more than one symbol for a dimension, select a row containing the dimension for which you want to add another symbol and click Symbol.
To move a symbol up or down within a dimension, click Move Up or Move Down.
Note: To use the symbol selected by the user or defined by an attribute, enter the name of the dimension as a variable, for example $ENTITIES$
Spec
Indicate the symbol specification using one of the following values:
- All: Includes all symbols within the selected symbol’s hierarchy.
- Leaf: Includes only leaf symbols within the selected symbol’s hierarchy.
- Parent: Includes only parent symbols within the selected symbol’s hierarchy.
- Root and Parent: Includes only root and parent symbols within the selected symbol’s hierarchy.
Note: To use the symbol selected by the user or defined by an attribute, enter the name of the dimension as a variable, for example $ENTITIES$
Level
Specify the number of levels down from the symbol to be included in the data area.
- Use Additional Configuration to specify any other Data Area Definition features you wish to use. Additional Configuration is a code editor that allows you to enter data area definition functions to be included in the data area.
For more information on the code editor, see "Using the code editor".
Typical use of Additional Configuration in a data area definition is to
- Add an attribute filter using the AttributeFilter function
- Add a schedule to the using the Schedule function
- Add a temporary symbol using the TempSym function
Specifying procedures
Use Procedures to create any additional procedures that are required as part of the app, event, or configuration library.
To create a procedure:
- Right click on Procedures and select New Document.
- For the Name, enter the name of your Procedure.
- In the code editor, enter the commands to run when the procedure is executed. For more information on procedures, see Developing Longview Procedures in the Longview Developer’s Guide.
Specifying models
Use Models to create models that are executed as part of the app, event, or configuration library.
To create a model:
- Right click on Models and select New Document.
- For the Name, enter the name of your Model.
- In the code editor, enter the code required for the model calculation. For more information on models, see Developing Longview Models in the Longview Developer’s Guide.
Specifying table definitions
To create a table definition:
- Right click on Table Definition and select New Document.
- For the Name, enter the name of your Table Definition.
- In the columns section the table and columns are defined.
- For the table name, select the table to use. The list includes all app tables defined in the system.
- If you pick a table based on a view it will display an information icon indicating that the table will be read-only.
- After selecting a table the columns in the table will be displayed. All columns will be selected by default. Also the columns that define the primary key will be indicated with a key icon. If some or all of the primary key columns are not included, the table will be read only.
- You may add or remove temporary columns using the Add Column and Remove Column buttons.
Note: Temporary columns are added to the table for use with an app, but are not submitted to the database.
- For each column complete the following fields:
Field Notes Include
Check each column to be included in the query. Use the check box in the header to select all columns.
Column
For persistent table columns, displays the name of the column. For temporary columns, enter the name of the column.
Nullable
Indicates whether the column can be saved with no value specified. If any non-nullable columns are excluded the table will be read-only.
Type
For persistent table columns, displays the data type of the column.
For temporary columns, select the data type for the column.
If you select Symbol[Dimension], you will be prompted to select the dimension that applies.
If you select Symbol[DimensionColumnName], you will be prompted to select a column (of type Dimension).
Values (String)
For String columns allows you to optionally define a list of values the user can select from.
Enter a | delimited list of values.
Optionally enter a | delimited list of display values by placing a semi-colon after the list of values.
Note: You can also use variables to define the list of values and display values.
Values
(Symbol)For Symbol columns allows you to limit the symbols available.
Enter a | delimited list of symbol specifications. You can also use a form to select the symbol specifications by clicking the search icon.
Note: You can also use a variable to define the list of symbol specifications.
Values (User)
For User columns, allows you to limit the users available for selection. Enter (or select) a | delimited list of user and group names.
Note: You can also use a variable to define the list of users and groups.
Values (User List)
For UserList columns, allows you to limit the users available for selection. Enter (or select) a | delimited list of user and group names.
Note: You can also use a variable to define the list of users and groups.
Allow Override
For String columns with Values defined, indicates whether the user can enter a value that is not in the list of values.
Min / Max (Date)
For date columns, allows you to set a valid range of selectable dates.
Note: The interface only supports explicit dates. To specify the valid date range using variables use the Additional Configuration section to define the date range using the SetColumn function.
Default (Boolean)
For Boolean columns, allows you to indicate if the default value for the column is checked.
Default (Dimension)
For Dimension columns, allows you to set he default dimension to be selected when a new row is added.
Default is no default selection.