Any way to bypass "is an alias for another element in dimension" process aborts?
Posted: Wed Sep 22, 2021 1:22 am
Hi guys,
Pretty sure the answer to my question is "no there isn't!" before I even ask this, but going to ask anyway in slim hope I'm missing something.
Question In Brief:
Is there anyway to override TM1's default error-abort behavior when using the alias of an existing element (instead of principalName) in an ElementInsert or ComponentAdd function?
Context of Question
Unfortunately I have a situation where our datawarehouse have changed a primary key on me. The are changing a four digit Business Unit into a three digit business unit. (PLML becomes PLM). This business unit exists as a rollup in many dimensions, as well as a leaf in the business unit dimension. Thankfully it is not hard-coded into any rules, however, there is quite a LOT of code in a LOT of different places which could be performing ElementInsert and ComponentAdd (both Dimension and Hierarchy variants) in the existing code base, and it performs the inserts and adds without any pre-checks.
Merging the two existing elements into one isn't really an issue. I can migrate the data and I can use SwapPrincipalName to retire one element and then make it an alias of the other. In fact I have done all that already.
The problem arises when datasources continue to pass me the old four-digit key into a process performing an ElementInsert or ComponentAdd function. As you'd expect, I always get "element is an alias for another element in dimension" error of course and then everything aborts in spectacular fashion!
I know I can bypass these errors by:
- Performing a DIMIX and only doing the functions if DIMIX returns 0 (although can't really do that in the ComponentAdds else leaves will be orphans)
- Use vBU = DimensionElementPrincipalName( 'dimension', vBU ) in all the relevant spots. (Solution I'll probably use)
- Straight up IF vBU @= PLML THEN vBU = PLM.
However, what would be the ultimate would be if TM1 recognised that alias as an existing element and just skipped over the error and let me keep going. I sincerely doubt there is any setting which will let me do this (there's at least none that I know of). But I wanted to ask anyway before resigning myself to just sitting down and needing to examine the entire architecture and put all these pre-checks / nameSwaps everywhere.
Thanks in advance guys if anyone can help and/or verify that I'm just hard out of luck. (I'm leaning towards being out of luck).
Pretty sure the answer to my question is "no there isn't!" before I even ask this, but going to ask anyway in slim hope I'm missing something.
Question In Brief:
Is there anyway to override TM1's default error-abort behavior when using the alias of an existing element (instead of principalName) in an ElementInsert or ComponentAdd function?
Context of Question
Unfortunately I have a situation where our datawarehouse have changed a primary key on me. The are changing a four digit Business Unit into a three digit business unit. (PLML becomes PLM). This business unit exists as a rollup in many dimensions, as well as a leaf in the business unit dimension. Thankfully it is not hard-coded into any rules, however, there is quite a LOT of code in a LOT of different places which could be performing ElementInsert and ComponentAdd (both Dimension and Hierarchy variants) in the existing code base, and it performs the inserts and adds without any pre-checks.
Merging the two existing elements into one isn't really an issue. I can migrate the data and I can use SwapPrincipalName to retire one element and then make it an alias of the other. In fact I have done all that already.
The problem arises when datasources continue to pass me the old four-digit key into a process performing an ElementInsert or ComponentAdd function. As you'd expect, I always get "element is an alias for another element in dimension" error of course and then everything aborts in spectacular fashion!
I know I can bypass these errors by:
- Performing a DIMIX and only doing the functions if DIMIX returns 0 (although can't really do that in the ComponentAdds else leaves will be orphans)
- Use vBU = DimensionElementPrincipalName( 'dimension', vBU ) in all the relevant spots. (Solution I'll probably use)
- Straight up IF vBU @= PLML THEN vBU = PLM.
However, what would be the ultimate would be if TM1 recognised that alias as an existing element and just skipped over the error and let me keep going. I sincerely doubt there is any setting which will let me do this (there's at least none that I know of). But I wanted to ask anyway before resigning myself to just sitting down and needing to examine the entire architecture and put all these pre-checks / nameSwaps everywhere.
Thanks in advance guys if anyone can help and/or verify that I'm just hard out of luck. (I'm leaning towards being out of luck).