Skip to main content
insightsoftware Documentation insightsoftware Documentation
{%article.title%}
Published:
Was this article helpful?
0 out of 0 found this helpful

Working with examples

Solutions framework includes several example apps built within the free form app template to help kick start implementation of commonly configured functionality. On initial installation, these example apps will be included and can be accessed in the Design module of the client.

Note: Examples are not fully functional apps but are intended to show examples of common functionality within the framework.

Solutions Framework Free Form examples

The example apps are included and updated in each release. The apps are intended as examples to be duplicated or copied from, but not modified to run as subsequent releases may include modifications.

To review an example app:

  1. Select the Design module
  2. Select the Apps category.
  3. Expand Configuration.
  4. Expand Free Form.
  5. Expand Existing Apps.
  6. Click in the Example app you wish to view or right-click on the Example app you wish to start with and select Duplicate to make a copy of it

The following sample apps are included:

The EXAMPLE - Framework app

The example framework app provides examples of using framework utilities described in the solutions developer guide. The example contains a procedure for each code library within the framework with sample code for each utility.

Execute Procedure

The execute procedure is intentionally blank as this example app is not intended to be run, but as a quick reference for using solutions framework utilities.

Procedures\CORE

The CORE procedure contains sample code for using the following CORE utilities:

  1. CreatePatternsLVDSP: Used to generate the data spec document to retrieve patterns from the database.
  2. GetDimensionIndex: Used to get the index of the defined dimension.
  3. Rollup: Used to perform a full rollup on a data area.
  4. GetKeyDimensions: Used to populate the variable CORE_KeyDimensionList with the list of key dimensions.
  5. ViewFile: Used to open the specified file in the default program configured on the user’s computer.

Procedures\DATA

The DATA procedure contains sample code for using the following DATA utilities:

  1. CreateTBLVDSP: Used to generate a data spec for custom dimensions to query the trial balance. The document generated needs to be appended to an existing data spec for the standard dimensions. The following specs are created:
    1. TBSrc: Contains specifications for each custom dimension as defined by attribute ASCFD<?>Source with the hierarchical specification: #0
    2. TBTrg: Contains specifications for each custom dimension as defined by attribute ASCFD<?>Target with the hierarchical specification: #99
    3. TBSrcDetail: Contains specifications for each custom dimension as defined by attribute ASCFD<?>Source with the hierarchical specification: #0
    4. TBSrcLeaf: Contains specifications for each custom dimension as defined by attribute ASCFD<?>Source with the hierarchical specification: ###
  2. ParseDsp: Used to generate the body of a data report input file from the specified data spec.

Procedures\DEBUG

The DEBUG procedure contains sample code for using the following DEBUG utilities:

  1. Message: Used to show or write a message only when troubleshooting mode is enabled.
  2. HistoryOff/HistoryOn: Used to temporarily suspend writing to the history log file when troubleshooting mode is enabled and detailed history logging is on.
  3. TimerStart/TimerStop: Used to measure the time to execute a series of commands when troubleshooting mode is enabled.

    Note: Detailed history logging must be enabled.

  4. VariableList: Used to write the value of one or more variables to the log file when troubleshooting mode is enabled.
  5. ExportDataArea: Used to export the values in one or more specified data areas to a file.

    Note: When used in an event the exported data file is appended to the log.

  6. WriteDocument: Used to append a dynamic document to the log file when troubleshooting mode is enabled.

Procedures\FORM

The FORM procedure contains sample code for using the following DEBUG utilities:

  1. SelectSymbols: Used to generate and display a form to select symbols from one or more dimensions.
  2. GenerateSymbolSelectors: Used to generate a document named SymbolSelectors that can be used to append symbol selectors to a dynamic form document.

The EXAMPLE - Import app

The example import app provides a quick way to implement an import processing using the IMP code library. The example contains sample procedure code for both Full and Incremental data import methods.

For more details on the IMP code library, see “IMP code library” in the Longview Developer’s Guide.

Note: This example assumes that a single data area spec named Main and a single import spec named Main will be used.

Execute Procedure

The execute procedure performs the following steps:

  1. Initializes IMP code library.
  2. Sets the name of the file to be imported in the IMP_FileName variable.

    Note: This is not required if the data source will be a SQL query executed via ODBC.

    Note: This variable can also be set via the ShowFileChooser command or a form.

  3. Checks that the specified file exists and throws an error if it does not.
  4. Locks the target data area
  5. Creates the target data area in memory

Procedures\FullImport

The FullImport procedure can be found in the Procedures folder and provides the rest of the commands required to execute a full import. Full import is used when the data source will replace the data in the target data area.

Note: Full import does not download the target data area and uses the RECONCILE Upload command. A user submission with status No Data will be created if there are no data changes.

Procedures\IncrementalImport

The IncrementalImport procedure can be found in the Procedures folder and provides the rest of the commands required to execute an incremental import. Incremental import is used when the data source will be added to the data in the target data area.

Note: Incremental import downloads the target data area and uses the Upload command. No user submission will be created if there are no changes to the data.

Procedures\Import

The Import procedure can be found in the Procedures folder and contains the actual Run Import command. The Import procedure is called by the IMP code library procedure OnImport.lvpro.

The EXAMPLE - Export Allocations app

The example export allocations app provides a quick way to export all allocations from one environment. This can be used as a tool along with the example import allocations app in order to migrate allocations from one environment to another. 

For more details on this example app, see Implementing allocations.

The EXAMPLE - Import Allocations app

The example import allocations app provides a quick way to import all allocations from a csv file. This can be used as a tool along with the example export allocations app in order to migrate allocations from one environment to another. 

For more details on this example app, see Implementing allocations.

Published:

Working with examples

Solutions framework includes several example apps built within the free form app template to help kick start implementation of commonly configured functionality. On initial installation, these example apps will be included and can be accessed in the Design module of the client.

Note: Examples are not fully functional apps but are intended to show examples of common functionality within the framework.

Solutions Framework Free Form examples

The example apps are included and updated in each release. The apps are intended as examples to be duplicated or copied from, but not modified to run as subsequent releases may include modifications.

To review an example app:

  1. Select the Design module
  2. Select the Apps category.
  3. Expand Configuration.
  4. Expand Free Form.
  5. Expand Existing Apps.
  6. Click in the Example app you wish to view or right-click on the Example app you wish to start with and select Duplicate to make a copy of it

The following sample apps are included:

The EXAMPLE - Framework app

The example framework app provides examples of using framework utilities described in the solutions developer guide. The example contains a procedure for each code library within the framework with sample code for each utility.

Execute Procedure

The execute procedure is intentionally blank as this example app is not intended to be run, but as a quick reference for using solutions framework utilities.

Procedures\CORE

The CORE procedure contains sample code for using the following CORE utilities:

  1. CreatePatternsLVDSP: Used to generate the data spec document to retrieve patterns from the database.
  2. GetDimensionIndex: Used to get the index of the defined dimension.
  3. Rollup: Used to perform a full rollup on a data area.
  4. GetKeyDimensions: Used to populate the variable CORE_KeyDimensionList with the list of key dimensions.
  5. ViewFile: Used to open the specified file in the default program configured on the user’s computer.

Procedures\DATA

The DATA procedure contains sample code for using the following DATA utilities:

  1. CreateTBLVDSP: Used to generate a data spec for custom dimensions to query the trial balance. The document generated needs to be appended to an existing data spec for the standard dimensions. The following specs are created:
    1. TBSrc: Contains specifications for each custom dimension as defined by attribute ASCFD<?>Source with the hierarchical specification: #0
    2. TBTrg: Contains specifications for each custom dimension as defined by attribute ASCFD<?>Target with the hierarchical specification: #99
    3. TBSrcDetail: Contains specifications for each custom dimension as defined by attribute ASCFD<?>Source with the hierarchical specification: #0
    4. TBSrcLeaf: Contains specifications for each custom dimension as defined by attribute ASCFD<?>Source with the hierarchical specification: ###
  2. ParseDsp: Used to generate the body of a data report input file from the specified data spec.

Procedures\DEBUG

The DEBUG procedure contains sample code for using the following DEBUG utilities:

  1. Message: Used to show or write a message only when troubleshooting mode is enabled.
  2. HistoryOff/HistoryOn: Used to temporarily suspend writing to the history log file when troubleshooting mode is enabled and detailed history logging is on.
  3. TimerStart/TimerStop: Used to measure the time to execute a series of commands when troubleshooting mode is enabled.

    Note: Detailed history logging must be enabled.

  4. VariableList: Used to write the value of one or more variables to the log file when troubleshooting mode is enabled.
  5. ExportDataArea: Used to export the values in one or more specified data areas to a file.

    Note: When used in an event the exported data file is appended to the log.

  6. WriteDocument: Used to append a dynamic document to the log file when troubleshooting mode is enabled.

Procedures\FORM

The FORM procedure contains sample code for using the following DEBUG utilities:

  1. SelectSymbols: Used to generate and display a form to select symbols from one or more dimensions.
  2. GenerateSymbolSelectors: Used to generate a document named SymbolSelectors that can be used to append symbol selectors to a dynamic form document.

The EXAMPLE - Import app

The example import app provides a quick way to implement an import processing using the IMP code library. The example contains sample procedure code for both Full and Incremental data import methods.

For more details on the IMP code library, see “IMP code library” in the Longview Developer’s Guide.

Note: This example assumes that a single data area spec named Main and a single import spec named Main will be used.

Execute Procedure

The execute procedure performs the following steps:

  1. Initializes IMP code library.
  2. Sets the name of the file to be imported in the IMP_FileName variable.

    Note: This is not required if the data source will be a SQL query executed via ODBC.

    Note: This variable can also be set via the ShowFileChooser command or a form.

  3. Checks that the specified file exists and throws an error if it does not.
  4. Locks the target data area
  5. Creates the target data area in memory

Procedures\FullImport

The FullImport procedure can be found in the Procedures folder and provides the rest of the commands required to execute a full import. Full import is used when the data source will replace the data in the target data area.

Note: Full import does not download the target data area and uses the RECONCILE Upload command. A user submission with status No Data will be created if there are no data changes.

Procedures\IncrementalImport

The IncrementalImport procedure can be found in the Procedures folder and provides the rest of the commands required to execute an incremental import. Incremental import is used when the data source will be added to the data in the target data area.

Note: Incremental import downloads the target data area and uses the Upload command. No user submission will be created if there are no changes to the data.

Procedures\Import

The Import procedure can be found in the Procedures folder and contains the actual Run Import command. The Import procedure is called by the IMP code library procedure OnImport.lvpro.

The EXAMPLE - Export Allocations app

The example export allocations app provides a quick way to export all allocations from one environment. This can be used as a tool along with the example import allocations app in order to migrate allocations from one environment to another. 

For more details on this example app, see Implementing allocations.

The EXAMPLE - Import Allocations app

The example import allocations app provides a quick way to import all allocations from a csv file. This can be used as a tool along with the example export allocations app in order to migrate allocations from one environment to another. 

For more details on this example app, see Implementing allocations.

For an optimal Community experience, Please view on Desktop