Executing a TI process from command line

Introduction

Since (I think) TM1 version 9.1, it is possible to use Action buttons in an Excel spreadsheet. Back at the old days, these buttons allowed us to execute TI processes and specify parameter values. Also, and afterwards, it became possible to jump to other applications files using action buttons, and/or to rebuilt sheets and active forms (TM1 9.4 and after). Here, we focus on executing processes in an automated way outside of TM1.

TM1 API

By using the TM1 API, it was feasible to set up coding that could execute a TI process. The code for that is far from easy, and luckily seasoned TM1 passionates like Mike Cowie wrote a nifty tool. See over here.

TM1RunTI

Although very much acknowledged by a lot of people and a very helpful tool, IBM has now come up with its own utility. It seems to be available from TM1 9.5.1 and 9.5.2. (Look at the hotfixes too.) By now, TM1 developers have a supported way of executing TI processes through command line. TM1 exposes tm1runTI (the file tm1runti.exe is part of the bin folder) and we can parameterize the whole thing in a number of ways.

Here are some of the uses / advantages I see (others will follow in later sections):

  • TI processes can be scheduled using the Windows Scheduler
  • Executing a TI process could be even done without opening the Server Explorer and logging in (or using difficult TM1 API coding in VB, .NET, ...).
  • Executing multiple processes in a sequential way after start up from the server is possible. For instance, a batch file could contain the usual NET START server name command followed by executing a process to set up cube dependencies.
  • Action buttons purely for executing TI processes can be embedded in other (existing) code. It removes manual interventions of users. [Beware: VBA-code will not work on TM1 Web]
  • We are increasing the opportunities to align TM1 with other systems in the organization: a command line tool is only what we need for TI processes (often critical when loading data from other systems).
  • Just to confirm, processes executed like this will be part of the TM1 message log.

Read more

Detailed information can be obtained from this useful forum thread. It contains documentation provided by IBM itself. Therein, we can see some of the following features of TM1runTI:

  • Executing a TI process, including parameters the process can have.
  • Possibility to connect to the TM1 server / environment using certain credentials.
  • Configuration parameters like adminhost, servername, user, password could be hard-coded, or read from a configuration file. This file can have multiple sections for custom parameters.
  • Passwords can be sent to the executable using decryption.
  • The tool can have return codes to capture whether the process runs well or not.

A concrete case

To make it practical, let us now look at how it works in a test case.

  1. Open up the Server Explorer, and create a TI process called "test". It contains the parameter P0 as string, and in the Prolog it contains: AsciiOutput('test of tm1runti.cma',P0);. Save the process and see if it works (a text file should be created in the data directory).
  2. Close all TM1 windows and open up a command prompt (hit Windows + R, type cmd and Enter)
  3. There, enter: tm1runti -server bv -user admin -pwd apple -process test P0=helloworld
  4. Change in the above wherever needed. Hit Enter and look again in the TM1 data directory for the specified TM1 server. Does it work?

That’s all it takes! Of course you can go much further (configuration files instead of hard-coded parameters, encrypted passwords instead of the real ones, executing this command from another TI process, and so on). To conclude, here is the code to execute the same process from Excel VBA:

Some code

Sub test_tm1runti()
' Wim Gielis ' https://www.wimgielis.com
''''' ' VBA-code to execute a TI process ' 13/06/11 '''''
MsgBox Shell("tm1runti -server bv -user admin -pwd apple -process test P0=helloworld", 0)
End Sub

Another example of TM1RunTI can be found here. Keep on programming! ;-)




Homepage

Section contents

About Wim

Wim Gielis is a Business Intelligence consultant and Excel expert

Other links