Page 1 of 1

User define function in TI

Posted: Mon Dec 01, 2014 7:25 am
by wang_chris
Just in curious, whether TM1 10.1 or above provide user define function in TI ?

I have a 100+ line code to be used in several places of same TI program. There would be very long for whole program, if I paste these code in every place. Can I write a user define function and call this function in right place?

Regards,
Chris

Re: User define function in TI

Posted: Mon Dec 01, 2014 9:01 am
by Gabor
Not possible in native TM1 TI.
However, recently added functions in TM1 10.2.2 like ExecuteJavaN / ExecuteJavaS should give the option to put your repeating code into a Java class and call it as a single line in your TI code.
I haven't done any testing on that so far, so I can't tell you the impact on TI performance.

Re: User define function in TI

Posted: Mon Dec 01, 2014 2:42 pm
by Steve Rowe
You can also use ExecuteProcess to call one TI from another, not sure what your common code does but if you need to pass values back to the calling process then you can either use global variables or write the values into a cube.
Probably a bit easier than learning Java..... ;)

Re: User define function in TI

Posted: Mon Dec 01, 2014 4:08 pm
by tomok
The java capability in TI is not talked about much but it really is a pretty big deal, assuming you have a java developer on hand or want to learn it. Now, all the things that TI can't natively do, it can now do with a bit of additional work. I've seen a lot of posts lately about populating cubes from a web service. Seems like a java extension to TI would fit the bill perfectly. You could probably even find open source code in the java world to give you a head start.