Contents

Custom Functions can be added to the User Defined Functions category of the Function Palette.

Defining Extensions

Functions can be created by performing the following steps.

Go to Tools menu in the eMapper perspective and click Create/Edit User Defined Function(s). The Extensions Dialog is shown in the figure below.


Figure 1: Extensions Dialog

This dialog has a list of all extensions that are defined.

  • To create a new extension, type the name of the extension to be created in the text area provided in this dialog and click OK.
  • To edit one of the existing extension, click on the extension and then press OK.
  • The Script Function Wizard will appear as shown in Figure 2. The wizard has two pages viz Script Information Page and Function Page.

Script Information Page

Extensions can be defined either in Javascript or Java language. The language of the extension being added can be specified from the Language list present in the Script Information Page.

The Javascript or the qualified name of the Java class, depending on the language of the extension, needs to be provided in this page.

  • To add Javascript functions, provide the Javascript and click Next. The script will be processed and the list of functions will be populated in the Function Page.
  • To add Java Functions, provide the qualified name of the Java class and click Next. The list in the Function Page will be populated with all the public static functions defined in this class.


Figure 2: Script Information Page

Function Page

The Function Page shows the list of functions that were defined in the Script Information Page. The user can select the desired functions and the selected functions will be added to the Function palette under the User Defined Functions category.


Figure 3: Function Page

Icon

While adding Java functions, the user has to add a .jar file containing the class defining the functions to the classpath in order to fetch the list of functions. This can be done through the Include jar to classpath option provided in the Script Information Page. Click the browse button and add the required jar file. Alternatively, the user can also add the jar to the mapper classpath by adding its path in Test Classpath table in the Mapper preferences page.


Figure 4: Adding Jar to classpath

Adaptavist ThemeBuilder EngineAtlassian Confluence