Page 1 of 1

Creating TI Process by running a TI Process

Posted: Sat Feb 25, 2023 9:05 pm
by vasek1192
Hello, the question of the day: Can you create a TI process in TI process? (inception sounds in the distance)

I would love to create a process that creates a TI process that would load data from cube determined by parameter into cube determined by another parameter. I would name it a Loadator_L_800 and be proud of my creation. I would however not like to spend a weekend trying to do something that cannot be done.

Generating the code and exporting it as .pro file into the right folder is doable, its just a question of right functions and looping yourself into oblivion but how to set up a Data Source is at this point beyond me.

Any thoughts?

Re: Creating TI Process by running a TI Process

Posted: Sat Feb 25, 2023 10:21 pm
by Wim Gielis
Hello,

I would indeed advise you to:
- first make a process yourself, with 2 cubes of "decent size". Let's say, about 6-8 dimensions. Add in some variety to make it more realistic and help in coding below.
- then inspect the PRO file and its structure. It will contain codes that are explained here by Alexander Sutcliffe based on findings of, among others, myself. Also see file:///C:/ibm/cognos/tm1_64/TM1JavaApiDocs/constant-values.html. Here Alexander wrote about the PRO file and its codes.

Like that, you can create a new TI process to generate a PRO text file with all necessary contents and correct encoding and such.
The Expand function will most probably be useful too.
Last step is to pick up the PRO file, drop it in the TM1 data directory, restart the model and it's done.

I did similar things in the past, but then from Excel VBA and hot promotion through the (old) VB API. It worked fine but also caused a lot of headaches. Random crashes and bad pointers, anyone ? Luckily, this is behind us.

Nowadays, there is the TM1 REST API which allows creating processes live using any tool of your liking, able to execute POST HTTP requests.
tm1py is a popular choice if you want to use Python scripting. Many other tools will be similar in spirit.

If you want to embark on the TM1 REST API journey, have a look here for starters, using Excel VBA - excellent material by George Tonkin.
With the TM1 REST API there is the possibility to use a POST request to /CompileProcess to ask the server whether the code is sound or does have compile errors, prior to posting the process definition. With /tm1.Compile you can verify whether an existing process that is in a running TM1 server, does not have syntax errors.

Last thing to add, you might also be interested in a generic Bedrock process. That could be an alternative solution and save you time.

Re: Creating TI Process by running a TI Process

Posted: Mon Feb 27, 2023 8:24 am
by lotsaram
I don't really have anything to add to Wim's already excellent post except to emphasize that creating a new process each time you want to load data from one cube to another seems like a very odd thing to do. Much better to simply have a generic process to do this job.

Re: Creating TI Process by running a TI Process

Posted: Mon Feb 27, 2023 9:42 am
by vasek1192
Thanks a lot, that was super helpful :)

Re: Creating TI Process by running a TI Process

Posted: Mon Feb 27, 2023 11:11 am
by Wim Gielis
I agree with Lotsaram. Generic processes exist.

Creating new processes is overkill, puts locks on the server, requires appropriate security, and will take time to develop and test.