How to create TI Process using TM1API?

Post Reply
olapuser
Posts: 40
Joined: Fri Jan 29, 2010 1:55 am
OLAP Product: Cognos TM1
Version: 9.5
Excel Version: 2007
Contact:

How to create TI Process using TM1API?

Post by olapuser »

All,

anyone know how to create the Turbo Integrator process using the TM1API?
really appreciate for help with sample code

Regards,
Ricky
VRGultom
Posts: 8
Joined: Tue Jan 12, 2010 4:44 am
OLAP Product: SqlServer 2005
Version: SqlServer 2005
Excel Version: 2005

Re: How to create TI Process using TM1API?

Post by VRGultom »

as I remember and understand TM1 API is not to create Turbo Integrater process, but to access TM1 through another system

For example if you want to create system using C or VB to access TM1, you have to connect to TM1 using the API
then from there you can access TM1 Cube, dimension etc

http://publib.boulder.ibm.com/infocente ... 70084.html

you have to use API because the system you created is not part of TM1 but need to connect to TM1 and access the data inside
Alan Kirk
Site Admin
Posts: 6647
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: How to create TI Process using TM1API?

Post by Alan Kirk »

VRGultom wrote:as I remember and understand TM1 API is not to create Turbo Integrater process, but to access TM1 through another system

For example if you want to create system using C or VB to access TM1, you have to connect to TM1 using the API
then from there you can access TM1 Cube, dimension etc

http://publib.boulder.ibm.com/infocente ... 70084.html

you have to use API because the system you created is not part of TM1 but need to connect to TM1 and access the data inside
Actually the API does appear to contain the necessary functions fro creating chores and processes. I haven't created any code for doing it yet (though plan to at least test it out when I have time), but given that it's the API with all the inherent flakiness and stability risks involved I'm not sure that it'd be my first choice for a production environment.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
olapuser
Posts: 40
Joined: Fri Jan 29, 2010 1:55 am
OLAP Product: Cognos TM1
Version: 9.5
Excel Version: 2007
Contact:

Re: How to create TI Process using TM1API?

Post by olapuser »

Alan Kirk wrote: Actually the API does appear to contain the necessary functions fro creating chores and processes.
here is some the code that appear in the API

Code: Select all

Declare Function TM1ProcessCreateEmpty Lib "tm1api.dll" (ByVal hPool As Long, ByVal hServer As Long) As Long
i do know how to pass the hPool and hServer parameters but i have no idea for the rest like datasourcename, prolog, metadata etc
Alan Kirk
Site Admin
Posts: 6647
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: How to create TI Process using TM1API?

Post by Alan Kirk »

olapuser wrote:
Alan Kirk wrote: Actually the API does appear to contain the necessary functions fro creating chores and processes.
here is some the code that appear in the API

Code: Select all

Declare Function TM1ProcessCreateEmpty Lib "tm1api.dll" (ByVal hPool As Long, ByVal hServer As Long) As Long
i do know how to pass the hPool and hServer parameters but i have no idea for the rest like datasourcename, prolog, metadata etc
I believe it's done via process property functions like TM1ProcessDataSourceNameForServer and TM1ProcessDataProcedure. However as I said, it's not something that I've attempted yet and I expect plenty of traps and gotchas especially in terms of the variables. Frankly unless you have a seriously compelling need to do this... I wouldn't. (But then that's true of most things when it comes to the API; it should always be the last choice rather than the first.)
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
olapuser
Posts: 40
Joined: Fri Jan 29, 2010 1:55 am
OLAP Product: Cognos TM1
Version: 9.5
Excel Version: 2007
Contact:

Re: How to create TI Process using TM1API?

Post by olapuser »

Alan,

Is there any way i can create a .pro file and put it in the data directory and restart the server?
when i look at the .pro in data directory there is a number which i think it is indicating the TI data source, variables etc

Code: Select all

562,"VIEW"
586,"plan_Report"
actually, i am finding a fast way to create 100+ TI with the same logic for 100+ cubes instead of copy and paste method

Thanks
Alan Kirk
Site Admin
Posts: 6647
Joined: Sun May 11, 2008 2:30 am
OLAP Product: TM1
Version: PA2.0.9.18 Classic NO PAW!
Excel Version: 2013 and Office 365
Location: Sydney, Australia
Contact:

Re: How to create TI Process using TM1API?

Post by Alan Kirk »

olapuser wrote:Alan,

Is there any way i can create a .pro file and put it in the data directory and restart the server?
when i look at the .pro in data directory there is a number which i think it is indicating the TI data source, variables etc

Code: Select all

562,"VIEW"
586,"plan_Report"
actually, i am finding a fast way to create 100+ TI with the same logic for 100+ cubes instead of copy and paste method
You're right, the (usually 3 digit) code numbers do correspond to the various components of a process. And in theory it's possible to generate them as plain text files and put them in the data directory. Provided that you make not a single mistake, corrupt not a single line (and bear in mind that another complicating factor is that some of the codes in a .pro file indicate how many rows of information appear below them, so you'd need to customise your text generation for that as well), then they should load correctly when you restart the server.

However... to my mind this would be a nightmarish exercise in maintenance for a start.

If the logic is the same for all of the processes and only the cube names are different, I really think that you would be far, far better off looking at creating some generic processes, and passing different parameters to them at runtime. It will vastly simplify your maintenance when you have to update the code, and use far fewer resources. Remember that if you have the same logic applying to multiple cubes you don't need multiple processes. Instead you could:
- Create a single process with parameters;
- Call that process using ExecuteProcess, passing it the name of the cube that you want it to act on (which could be hard coded, read from a control cube, even user input if you want);
- Indeed even if you need the data source to be from different cubes you can change the source at runtime using TI variables like DatasourceCubeview; just assign the parameter value in the Prolog.

Far safer and less messy than using the API or attempting to generate your own text files. Most likely faster as well.
"To them, equipment failure is terrifying. To me, it’s 'Tuesday.' "
-----------
Before posting, please check the documentation, the FAQ, the Search function and FOR THE LOVE OF GLUB the Request Guidelines.
olapuser
Posts: 40
Joined: Fri Jan 29, 2010 1:55 am
OLAP Product: Cognos TM1
Version: 9.5
Excel Version: 2007
Contact:

Re: How to create TI Process using TM1API?

Post by olapuser »

Alan, thank you for the help
yes, run time view is better choice
User avatar
brandonchua
Posts: 8
Joined: Sun Jul 05, 2009 11:46 pm
OLAP Product: TM1
Version: 913
Excel Version: 2007

Re: How to create TI Process using TM1API?

Post by brandonchua »

What i normally do is replicate an existing process and change the values of the various properties of that object.

Of course you can create one from scratch but the registration of that process with TM1 server is another lengthy coding process. You have to do many checks to make sure you are not going to crash the server with duplicates. (I have been reprimanded so many times for that. And No TM1Top can find you) Hehehee...

Once I've created a Input file comparison tool (exe) to look at the differences between the source input file (Data Source) and the existing TI process. Replicating existing TI into a new and then once i am done with manipulating it, I over write the existing one. What a NightMare i have created for myself. But at that point, it was the only way moving forward until we fix the real Source issue. And I use a TI to run this almighty executable.

CLUE: A good way to start would be to start with the understanding of TM1ObjectReplicate.

I am happy to help you if you give me some more hint on the problem you are facing.
Eg. problem with Data Source? Changing Variables/Parameters issues? Metadata needs to re-align automatically? Blar... Blar... Blar...

Good luck!
Brandon Chua
Senior MIS Analyst
TNT Express
brandon_chua@tnt.com.au
brandon.chua@three.com.au
olapuser
Posts: 40
Joined: Fri Jan 29, 2010 1:55 am
OLAP Product: Cognos TM1
Version: 9.5
Excel Version: 2007
Contact:

Re: How to create TI Process using TM1API?

Post by olapuser »

brandonchua wrote: I am happy to help you if you give me some more hint on the problem you are facing.
Eg. problem with Data Source? Changing Variables/Parameters issues? Metadata needs to re-align automatically? Blar... Blar... Blar...
what i am facing currently is to create 100+ TIs for different cubes and number of dimensions, solved with an output file by loop for each cube and dimensions.

i thought it would be useful to create such an Advanced TI Editor with intellisense, syntax color etc.
syn.JPG
syn.JPG (8.87 KiB) Viewed 9215 times
ParisHilton
Posts: 73
Joined: Fri Apr 23, 2010 11:35 am
OLAP Product: Tm1
Version: 9.5
Excel Version: 2007 2010

Re: How to create TI Process using TM1API?

Post by ParisHilton »

The tm1.api does expose a TMCreateEmptyProcess, but little more than that. Maybe they started working on it, then decided there wasn't the demand.

I'm working on a far better rules editor , the current one seems worse than notepad. I'd like it to work for processes too, which won't be easy without access to API functions. I'm so frustrated with the TI editor though, I might have to just import and export the .pro file which sounds very risky. Still copy and paste is always an option!
“The way I see it, you should live everyday like its your birthday”


TM1 9.5 Cognos BI 8.4 Excel 2007. 128GB Ram. E7450@2.40Ghz -24 core. Fluffy white dog.
lotsaram
MVP
Posts: 3702
Joined: Fri Mar 13, 2009 11:14 am
OLAP Product: TableManager1
Version: PA 2.0.x
Excel Version: Office 365
Location: Switzerland

Re: How to create TI Process using TM1API?

Post by lotsaram »

ParisHilton wrote:I'm working on a far better rules editor , the current one seems worse than notepad.
:!:
The default editor basiclaly is not quite notepad but have you tried setting AdvancedRulesEditor = T in the tm1p.ini file?
ParisHilton
Posts: 73
Joined: Fri Apr 23, 2010 11:35 am
OLAP Product: Tm1
Version: 9.5
Excel Version: 2007 2010

Re: How to create TI Process using TM1API?

Post by ParisHilton »

lotsaram wrote:
ParisHilton wrote:I'm working on a far better rules editor , the current one seems worse than notepad.
:!:
The default editor basiclaly is not quite notepad but have you tried setting AdvancedRulesEditor = T in the tm1p.ini file?

I have. I don't really like the advanced editor either. It's almost there, but it seemed quite buggy when selecting text or trying to tab and move around.

--EDIT-- I'm trying it again. It seems MUCH better. Thanks lotsaram
“The way I see it, you should live everyday like its your birthday”


TM1 9.5 Cognos BI 8.4 Excel 2007. 128GB Ram. E7450@2.40Ghz -24 core. Fluffy white dog.
Post Reply