TIBCO EBX®
Rules Portfolio Add-on Documentation > Scripting Language
Navigation modeRules Portfolio Add-on Documentation > Scripting Language

Using the script editor

Overview of the script editor

To simplify script implementation, the script editor provides an array of useful features. The following section describes how the editor:

Checking and highlighting the syntax

When you write your code in the script editor, it displays in different colors based on the category of terms. This feature improves readability and allows you to distinguish between different contexts.

/100000000000016700000080FCF4FF7C.jpg

If your code is syntactically incorrect, the script editor automatically raises alerts. In line three of the example below a red 'X' indicates a problem. By hovering over the icon, a message alerts you to the missing element. The yellow caution icon indicates a warning that might not break your code, but really is not a best practice either.

/100000000000019300000089173A2A57.jpg

Search and replace.

This basic - yet important function - can greatly assist you in keeping long and complicated code under control. The script editor supports both finding and replacing code.

You can use the 'Search' function by pressing the 'Ctrl + F' key combination. The search box contains the following features:

/Search_And_Replace_1.png

Use the key combination of 'Ctrl+H', to display the 'Replace' feature. Enter your replacement text in the box and click 'Replace' to update individual occurrences, or click 'All' to update all found occurrences.

/Search_And_Replace_2.png

Code auto-suggest

The script editor's auto-suggestion feature helps speed up the process of coding by reducing typos and other common mistakes. A main function of this feature is that it provides suggestions about methods associated to predefined objects.

/10000000000001AB000000B090B0BAFD.jpg

'Data structure' panel

When using a script implementation, most tasks require you to frequently enter node paths. Correctly remembering each path in the data model can be very difficult. And, if you type paths incorrectly, the script will not work. To alleviate this burden, the script editor can display your data structure, allow you to select a node, and insert its path.

To use the 'Data structure' panel:

/Data_Structure_Panel.jpg

/Data_Structure panel_2.png

Note that the 'Data structure' panel only displays the model of the data set on which the rule executes.