...
First the internal store cubes_status
for cube splicing status will be resetset to False
. The status store is used to store success or error flag per each cube during splicing and file name of associated backup file that is created before the rule is modified by the Splicer. The False
value is indicating failure - the status will need to be set to True
when the method finishes successfully.
Then the method will establish a new TM1DirectiveResolver
instance (Containers (package) ) and will parse the rule. It will get a parse tree of the rule as a result of a call to TM1RuleParser.get_parse_tree
method. The parse tree is in-memory representation of the parsed rule composed by interlinked objects from Objects
package (Objects (package) ). These objects are allocated by the parser implemented by TM1RuleGrammar
(Parser/Grammar (package) ) through methods make_
or add_
defined in TM1RuleParser
(Parser (package) ) according to the PEG grammar (Parser/Grammar (package) ).
...
The method then calls TM1Parser.get_rule
to splice the rule by calling convert
method of each object in the parse tree and get the text representation of the modified parse tree. This string will be used to patch the cube rule in TM1. Before it is attempted, the method will first check if there are any changes by comparing original rule with a rule retrieved from the modified parse tree. If the rules are not identical, it will save the string into a proposed file in the proposed rule folder (configured from command line, default location is rule
), otherwise it will skip further steps and the method will set the cube status in cubes_status
store to True
and will return without errors signalling to the caller to continue with a following cube rule.
After the changes are saved in the proposed file, the method will patch the cube with updated rule and will run check of the rule on the TM1 server. An exception will be generated if the check fails, the cube status will not be set to Error updated in the cubes_status
store (initial value was already set to False
to indicate failure) and rollback of changes will be provided, otherwise the method returns run. Otherwise the method will set the cube status in cubes_status
store to True
and will return without errors signalling to the caller to continue with a following cube rule.
...