Enterprise power with human face

Saturday, September 29, 2012

TM1 API Architecture

There are two major problems which need to be solved generally when designing APIs :
  • How can we "request" the provider for specific data output?
  • How will the provider "respond"?
Making the request

The request can be interpreted as notification and command to return data. The most appropriate way how to execute commands in TM1 and transfer data on demand is TM1's internal TurboIntegrator process. However, how to call internal processes from outside the TM1 environment? Fortunately, in TM1 9.5.2 Hotfix 1, very handy utility for developers called TM1RunTI.exe has been introduced. TM1RunTI.exe simply allows running processes with set of parameters from proprietary command line. Therefore, to make the request, you only need to execute system calls pointing to TM1RunTI.exe with your favorite server-side scripting language such as PHP or even better asynchronously from front-end scripting languages like JavaScript.
The request is visualized in the upper part of the TM1 API call circle picture.

Providing the response

Basically, there are two options how to provide response using Cognos BI or temporary text file. You can read more about pros and cons of both approaches in the following article. While the second option seems to be easier and does not require Cognos BI, we will further leverage this approach. The incoming command from web browser (request) firstly calls TurboIntegrator process preparing data and exporting them to text file. Because TM1 TextOutput does not allow formatting data into XML or JSON standard, few adjustments have to be done to obtain desirable structure. The structured content of the file is subsequently read by PHP and outputted directly to the browser or processed by JavaScript.
The data flow is visualized in the bottom part of the TM1 API call circle picture.
TM1 API call circle
The visualization serves as top level overview of architecture and employed technologies.
You can read more about particular steps in following articles.  

No comments:

Post a Comment