Contents

User-defined funclets that are created in the Mapper perspective can be stored in multiple places in the Fiorano installation.

The two repositories meant for storing funclets are:

  • Local Funclet Repository: The funclets that are created inside a mapper transformation in an Event Process, for example, in a component like Xslt or on a port or on a route, are stored in Local Funclet Repository.
  • Global Funclet Repository: The funclets that are created in Configuration Repository view of Offline or Online perspectives are stored in Global Funclet Repository of respective perspectives.

Both the repositories are explained in detail in the following sections.

Local Funclet Repository

In the Offline/Online perspective, the User Defined Functions dialog box have more options apart from Remove and Edit buttons present in the Mapper perspective.

Click the "Creating/Editing User-defined Function(s)"  icon to open the User Defined Functions dialog box.


Figure 1: User Defined Functions dialog box with functions added in the Event Process perspective

The table below provides information about each button, starting with the Add option to add funclets, in the User Defined Functions dialog box.

PropertyDescription
Add

Opens a new script wizard to add a function.

RemoveRemoves the function selected and deletes it from the location where it was added (using the Add button) as well.
Import fromImports user-defined functions added in any event process. The specific funclet can be imported into the mapping from the list of existing functions.
Export to Global RepositoryExports funclets to the Global repository (refer the section below to understand more about Global Repository).
EditHelps to make changes to the selected script.

The funclets created in the Local Funclet Repository are saved in the machine where eStudio is launched. These funclets can be seen in Funclet View of this particular eStudio application which is attached to the machine.

Example: %FIORANO_HOME%/eStudio/plugins/com.fiorano.tools.mapper.runtime_1.0.0/resources/functions.repository.

The following scenario explains the availability of funclets in transformations created in Local Funclet Repository:

  1. In Machine1, launch eStudio, login to Enterprise Server and create an Event Process EVENT_PROCESS1 with a service instance of the Xslt component.
  2. Launch CPS (Configuration Property Sheet) of the Xslt component, open Mapper, and create a funclet "FUNCLET1".

    Icon

    FUNCLET1 will be available in User Defined Funclets in Funclet View.

  3. Use FUNCLET1 in a mapping, save and close the mapping.
  4. Create another Event Process EVENT_PROCESS2 with another service instance of Xslt.
  5. Launch the Xslt CPS, open mapper and navigate to User Defined Funclets in Funclet View. 

    Icon

    FUNCLET1 will be available here and can be used in new mappings since this event process is created in the same Machine1.

  6. Now, login into the same Enterprise Server from a different machine "Machine2".
  7. Open EVENT_PROCESS1 and open the Xslt CPS.

    Icon

    The mapping created earlier with FUNCLET1 will be present and existing transformation will work fine.

    However, the funclet FUNCLET1 will not be available in User Defined Funclets in Funclet View. So, new mappings with the same funclet cannot be created.

    To use FUNCLET1 in Machine2, export EVENT_PROCESS1 in Machine1 and use the Import from option. This is where Global Funclet Repository becomes relevant.

Global Funclet Repository

The user-defined funclets in the Local Funclet Repository can be created and shared globally to use across eStudio applications in multiple machines which connect to the same Enterprise Server.

In eStudio, Offline and Online perspectives will have separate global funclet repositories:

  • In the Offline perspective, funclets will be stored in the same machine as eStudio at
    %FIORANO_HOME%\runtimedata\eStudio\workspace\.repositories\Offline\Configurations\funclet\development
  • In the Online perspective, funclets will be stored in Enterprise Server at
    %FIORANO_HOME%\runtimedata\repository\configurations\funclet\development

Adding a funclet to the global repository

In Offline/Online perspective, go to the Configuration Repository view and perform the following actions:

  1. Right-click the Funclet node, and click the Add Configuration option. 


    Figure 2: Context menu to add Configuration

  2. Cick the Add button and provide a name for the funclet in the Extension Name text field that gets displayed, and click the Edit button below the text field.


    Figure 3: Option to add funclets

    Icon

    The table below provides information about each button, starting with the Add option to add funclets, in the Add New Configuration dialog box.

    PropertyDescription
    Add

    To add a funclet, click Add, provide Extension Name, and click Finish to open a new script function wizard.

    RemoveRemoves the selected funclet from the repository.
    Import Local FuncletsEvent Process Repository: The custom funclets added in any event process in the event process repository get displayed from where the required funclet can be chosen.

    Exported Event Process: The custom funclets present in an exported event process get displayed from where the required funclet can be chosen.

    Import Global FuncletsTo import the funclets that are exported previously from global repository to the local disk.
    Export to Local DiskThe selected funclet will be zipped and saved in the location specified.
  3. Add the script for the funclet in the Type in the script here text area and click Next.

    Icon

    Only javascript functions can be added to the global repository.


    Figure 4: Script Information pane with the javascript language option

  4. Select one or more of the functions to appear in the function palette and click Finish.


    Figure 5: Option to choose funclets to appear in function palatte

  5. Click Close/Save.


    Figure 6: Option to edit or close

  6. The global funclet gets added under the Funclet node; expand to see the same.


    Figure 7: Global funclet appearing under the Funclet node

Editing the script in the added funclet

To edit the script in the added funclet, perform the following actions:

  1. Expand the Funclet node, right-click the GlobalFunclets node and click Edit.


    Figure 8: Context menu option to edit the funclet script

  2. Select the funclet that needs to be edited and click Edit.


    Figure 9: Option to edit the funclet

  3. Edit the script in the Script Information section in the New Script Function dialog box and click Finish.

Points to note

Icon
  • During runtimedata migration, the funclets in Global Repository will also be migrated along with all other configurations in Enterprise Server.

  • While adding new funclets, if a funclet in the global repository (global funclet) and a funclet defined in an event process (local funclet) have the same name, the local funclet takes precedence and will be shown in Funclet View while editing a transformation in Mapper.

  • When a global funclet is edited in Online perspective, a running event process should be restarted to reflect the changes in a port or route transformation during runtime. If the funclet is used in a service instance transformation, like Xslt, restarting just the component will suffice.

  • When exporting event processes using global funclets, the funclets should be exported from the global funclet repository explicitly. The same is to be done while importing these event processes.

    Icon

    Support for exporting the funclets along with the event process will be added in future releases.

Adaptavist ThemeBuilder EngineAtlassian Confluence