You can write the JavaScript or Groovy code in the text area on the
Script tab. A JavaScript function skeleton is displayed by
default. Use this skeleton code as the basis for your JavaScript code. You can
also load an existing JavaScript or Groovy script from the Script
library by clicking the Show script library button.
On the Script library dialog, click any of the Configured
scripts in the table to display the script in the text area on the right.
You can edit a script directly in this text area. Make sure to click the
Update button to store the updated script to the Script
library.
You can add a new script to the library by clicking the Add
button, which displays the Script Details dialog. Enter a
Name and a Description for the new
script in the fields provided. By default, the Language
field is set to JavaScript, but you can also select Groovy from the drop-down
list. You can then write the script in the Script text area.
Important Note:
When writing the JavaScript or Groovy code, you should note the following:
-
The
invoke() method must be
implemented.
-
The
invoke() method takes a
com.vordel.circuit.Message object as a parameter,
and returns a boolean.
-
You can obtain the value of a message attribute using the
getProperty method of the
Message object.
|