FAP extension points

TM1® as a platform opens up endless possibilities when it comes to customizing the default FAP cubes, that is, to incorporate specific customer requirements into the reporting solution.

One available TM1 mechanism is the TI scripts (Turbo Integrator). For more information, see the TM1 user documentation.

FAP provides several script place holders, that is, distinct places in the code where the FAP Service will look for Turbo Integrator scripts on the TM1 server and if they follow a certain naming convention execute them. Available place holders are:

Table 1. FAP extension points
Extension point Description
ccr_ip_before_[a-zAZ0-9] Before initial publish.
ccr_ip_middle_[ a-zAZ0-9] In the middle of initial publish (after dimensions/structures, before data).
ccr_ip_after_[a-zAZ0-9] After initial publish.
ccr_pc_before_[a-zAZ0-9] Before publish children. Step 1 for slowly moving dimensions (move dimensions to TM1 for data trickle to work).
ccr_pc_after_[a-zAZ0-9] After publish children.
ccr_us_before_[a-zAZ0-9] Before update structures. Step 2 for slowly moving dimensions (re-generate the TM1 dimensions).
ccr_us_after_[a-zAZ0-9] After update structures.
ccr_dt_before_[a-zAZ0-9] Before data trickle.
ccr_dt_after_[a-zAZ0-9] After data trickle.

Several scripts can be executed at each step. They are then run in alphanumeric order, for example, A1 runs before A2. Although this document is not intended to cover possible TI scripts a couple of examples are provided.

This script would add an "All" node to the company hierarchy.

While (j <= Dimsiz('Company'));
  Element = DIMNM('Company', j);
  If (DTYPE('Company', Element) @= 'C');
    # All should not be included into itself.
    If (Element @<> 'All');
      # Consolidation types should not be included. They are always
of size 2.
      If (Long(Element) <> 2);
        # Consolidation type + period should not be included. They
are always of size 2+1+7=10.
        If (Long(Element) <> 10);
          DimensionElementComponentAdd('Company', 'All', Element,
0);
        EndIf;
      EndIf;
    Else;
       allIindex=j;
    EndIf;
  EndIf;
  j = j + 1;
End; 

This example describes how an attribute can be added to the Company dimension, with just the code from Controller.

# Add one extra attribute: 'Company Code' containing
the controller code,
# except QAR companies, which gets their prefix.
AttrInsert('Company', 'Local Currency', 'Company Code', 'S');
i = 1;
While (i <= Dimsiz('Company'));
  Element = DIMNM('Company', i);
  If (DTYPE('Company', Element) @= 'C');
    # Consolidated nodes
    CodeLength = Long(Element);
    If (CodeLength > 10);
      CodeName = SUBST(Element, 12, CodeLength - 10);
      AttrPutS(CodeName , 'Company', Element, 'Company Code');
      # Copy attributes from leaf to consolidated node.
      EN_longName = ATTRS('Company', CodeName, 'EN_long');
      AttrPutS(EN_longName, 'Company', Element, 'EN_long');
      EN_shortName = ATTRS('Company', CodeName, 'EN_short');
      AttrPutS(EN_shortName, 'Company', Element, 'EN_short');
      SV_longName = ATTRS('Company', CodeName, 'SV_long');
      AttrPutS(SV_longName, 'Company', Element, 'SV_long');
      SV_shortName = ATTRS('Company', CodeName, 'SV_short');
      AttrPutS(SV_shortName, 'Company', Element, 'SV_short');
    EndIf;
  ElseIf (DTYPE('Company', Element) @<> 'C');
    AttrPutS(Element, 'Company', Element, 'Company Code');
  EndIf;
  i = i + 1;
End;