This is a base package of Splicer containing a CLI wrapper implemented in splicer.py
source file and splicing logic implemented in TM1SpliceExecutor
class. The class is described in detail below.
TM1SpliceExecutor
(class in TM1SpliceExecutor.py
)
The class implements splicing and desplicing logic in two entry point methods that are called from splicer.py
when splicing or desplicing is required from the command line.
Initialization
The class is initialized before splicing or desplicing from parser.py
and when the init is finished, the instance of TM1SpliceExecutor
will have TM1SpliceConfigContainer
associated with itself and all configuration files will be already loaded into memory. The configuration data is provided to TM1SpliceExecutor
transparently through the TM1SpliceConfigContainer
instance (more about the configuration container can be found in Containers (package)
The connection with the TM1 instance is established during the initialization as well.
Splicing
Splicing logic is implemented in splice_cube_rules
method and contains following steps.
First, the method will determine and call TI processes to be run before commencing splicing. The list of processes is configurable and might be added if required to kpi_template.json
configuration file to preprocess_TI::Splice
object. The list is retrieved from TM1SpliceConfigContainer
instance associated with the TM1SpliceExecutor
.
Then the method will establish a list of cubes for splicing. The list can be either all cubes as configured in fpm.json in Cubes object (--all option), or a list supplied from command line (--cubes option) or a list of cubes containing supplied list of dimensions to a command line (--dimension option).
Then it will loop all the cubes in the list and will call individual cube splicing for each cube.
After the loop is finished, the method will determine and call TI processes to run after splicing. The list of processes is configured in kpi_template.json in postprocess_TI::Splice
object.
Finally the method will check status of each cube that was spliced to see if any errors have occurred during splicing. If an error was detected during splicing, the changes that have been committed by Splicer will be rolled back.