The way the programmer implemented it, all the elements are deleted in the 'Prolog' section and then created them again in the "Metadata" section (based on a csv file that include the old and new months to be created). The attributes are set in the 'Data' section.
Simplification of the code:
Prolog:
Code: Select all
DimensionDeleteAllElements(vDimName);
AttrDelete(vDimName, 'desc');
AttrInsert(vDimName, '', 'desc', 'A');
Code: Select all
DimensionElementInsert(vDimName,'',Periode,'N');
Code: Select all
AttrPutS(Periode, vDimName, Periode, 'Desc');
There are no good reason to delete the existing elements so I consider rewriting the code to only add the new elements.
Still, I'm curious to know why the existing process work at all. I ran the code in a test environment and there is no data lost. Assuming that the process doesn't crash, is it actually safe? Are the dimension maintained until the end of the process even if in theory they have been deleted, and since they are created again, there is no real risk (beside a crash of the process)?