Simple Concepts of Turbo Integrator Scripting

Turbo integrator is one of tools in TM1 that we can use to write business logic. Turbo integrator editor has four tabs which are: Prolog, Data, Metadata, Epilog.

1.    Prolog

  • Initial state
  • One time execution

2.    Metadata

  • Looping (n times execution, where n is equal to number of data lines)
  • Do anything related to metadata such as Insert elements, delete elements, arrange hierarchy elements, etc

3.    Data

  • Looping  (n times execution, where n is equal to number of data lines)
  • Do anything about data itself (data point), such as Query data (CellGetN/S, CellPutN/S, etc)

4.    Epilog

  • Final State
  • One time execution

If I compare to what my lecturer had explained about the basic concept of programming in any language, I can describe the Turbo Integrator Programming Structure like this:

Image

The initial state is prolog, the place where we define anything required before data processing

The first loop is metadata tab, the place where we do anything about metadata such as registering new elements, delete elements, etc

The second loop is data tab, the place where we do anything about data point, such as query data using cellgetn/s, cellputn/s, etc.

The final state is epilog, the place where we do anything required after data processing. For example move data source from current location to backup location.

From that structure, we know how many times one command will be executed.

Tips:

  1. If you need to define a constant value to be processed in metadata or data, define it in prolog, since the value is constant. Do not put it on metadata or data tab, otherwise it will be executed as many as data lines, which is no point because the value will never change.
  2. If you need to generate output through the process, define the header in prolog, generate the content on metadata or data (depend on the requirement) and define the footer on epilog.
  3. If you need to count how many lines of data to be processed, put the initial value on prolog and put the counter on metadata or data tab, and asciioutput the last counter on epilog.
  4. etc

My lecturer, few years ago, always reminded us that computer is stupid, we need to provide clear commands to make it work for us. 😀

It is up to you whether you only create scripts just to process data and generate output based on business requirements but do not care about the performance, or build a system with good performance and make users happy. If users happy with the system, usually they will ask more features to improve capability of the system. But, if you have to stand by 24 hours for support, you should do optimization on your system or even fix your ‘back end’ here and there.

Veronika Rotua Gultom


3 thoughts on “Simple Concepts of Turbo Integrator Scripting

  1. Great post.We also disable cube logging in prolog as well as use mirrorskipcount =-1 so that if minor errors encountered the process continue to progress and enable the cube logging in epilog.Thanks again for sharing the knowledge and expertise.

  2. Pingback: Get Out from Looping Process. | VRGultom

Leave a comment