Scripts
Overview
FIXICC H2 allows managing and editing server scripts via UI. After editing, the changes will be applied to the business layer configuration in run time.
To view server scripts:
- Click Configurations > Servers > Show all servers (left menu bar)
- Select a server in the Servers table view
- Click Configurations > View Scripts in the Object view
- Script table view is opened in a new tab
Figure. View server scripts
Script table view
Overview
The script table view contains:
- A filtering pane
- An action pane
- A list of scripts in the table
Figure. Script table view
Filtering pane
The filtering pane allows filtering the list of scripts by:
- Name
- Description
- Category (General, Routing, Transformation, Enrichment, Storage, Multi-purpose, Util)
- Language (JavaScript, XSLT)
- Status (Enabled, Disabled)
Action pane
- Create - Allows creating a new script or loading an existing script from a file
- Clone - Opens a copy of the selected script for editing in a new tab
- Edit - Opens the selected script for editing in a new tab
- Remove - Removes the selected script
List of scripts
The list of scripts contains a filtered list of scripts in the table.
You can customize the table or sort it by any attribute.
Figure. Table sorting and customization
Script details view
The script details view contains the following script details:
- Name
- Language (JavaScript, XSLT)
- Category (General, Routing, Transformation, Enrichment, Storage, Multi-purpose, Util)
- Status (Enabled, Disabled)
- Script body
Figure. Script details
The options in the script details view include:
- View in tab - Opens the script details in a new tab
- Edit - Opens the script for editing in a new tab
- Disable/Enable - Disables/enables the script
- Additional menu - Allows removing the script
Creating a script
To create a new script:
- Click Create in the Script table view
- Click Create new JavaScript or Create new XSLT
Figure. Create dropdown (Create script)
Uploading a script
To upload an existing script from a file:
- Click Load in the Script table view
- Click Load JavaScript file or Load JavaScript file
Figure. Create dropdown (Upload script) - Drop the script file on the pop-up dialog or click Upload to browse files on your computer
Figure. Upload file
Removing a script
To remove a script:
- Select a script in the Script table view
- Click Remove in the Script table view or click Remove in the Script details view
Figure. Remove script
The script cannot be removed until it is used in the business layer configuration.
Enabling/disabling a script
Scripts can be enabled or disabled. A disabled script is considered a draft and cannot be used in the business layer configuration.
To enable/disable a script:
- Select a script in the Script table view
- Click Enable/Disable in the Script table view or click Enable/Disable in the Script details view
Figure. Enable/disable script
The script cannot be disabled until it is used in the business layer configuration.
Editing a script
FIXICC H2 allows editing the scripts via the editor. After editing, the changes will be applied to the business layer configuration.
Opening the script editor
To open a script for editing:
- Click Edit in the Script table view
or - Click Edit in the Script details view
Figure. Edit script
Script editor
Figure. Script editor
Script attributes
- Script name (mandatory)
- Description
- Status
- Category (mandatory)
- Language (mandatory)
All mandatory fields are marked (*) on the UI.
Uploading a file
To upload an existing script from a file:
- Click Upload
- Drop a script file on the pop-up dialog or click Upload to browse files on your computer
Figure. Upload file
The script editor does not recognize the language of the uploaded script. The script language should be defined manually.
Saving a script
To save changes, click OK.
To cancel editing, click Cancel. Doing so will close the editor tab.
Using inline scripts
FIXICC H2 allows using inline scripts in the business layer configuration (Business Rules).
To include an inline script in a business rule, insert the tag <Script> with the attribute ScriptName. The tag <Script> must contain the tag <Content>, with the script body in CDATA format.
The script name must be unique for the server.
Example:
<Rule Description="A Rule #3"> <Action> <Script ScriptName="script_name"> <Content> <![CDATA[<!--Script body--!>]]> </Content> </Script> </Action> </Rule>