Extending : Global function extension : Registering global functions for runtime
  
Registering global functions for runtime
For global functions that run on the server side, the implementation Java class of the global function must be registered in the btt.xml file so that it can be invoked at runtime.
In the btt.xml file, search for globalFunctions, and then add a new entry for the implementation class. The ID of the entry should be the same as the name that is used for registering the global function for tooling, and the value should be the implementation class. In the following code sample the line that is marked in bold is an example of registering a global function for runtime.
Note The global function class must be added in the referenced library of runtime project.
Registering the implementation class of a global function in the btt.xml file
<kColl id="globalFunctions">
  <field id="BTTStringFunctions" value="com.ibm.btt.utils.GlobalFunctions" />
  <field id="BTTDateFunctions" value="com.ibm.btt.utils.GlobalFunctions" />
  <field id="BTTNumberFunctions" value="com.ibm.btt.utils.GlobalFunctions" />
  <field id="BTTCollectionFunctions" value="com.ibm.btt.utils.GlobalFunctions" />
  <field id="ExtensionFunctions" value="com.ibm.btt.alphasample.drop3.globalfunction.ExtendFunctions" />
</kColl>
For global functions that run on the browser side, global functions are mapped Javascript object automatically; therefore, the object name of the Javascript implementation should be the same as the name that is used for registering the global function for tooling.
Go up to
Global function extension