In Systemwalker Runbook Automation Studio, JavaScript expressions are used with the following elements:
Complex Conditional Nodes
Java Actions
Triggers
Sequential Loop Nodes
Several software controls are provided to help you build JavaScript expressions more effectively and easily. The following figure shows an example:
Figure 11.47 Defining JavaScript Expressions
Key:
1 Expression Mode Button
2 Expression Field
3 Expression Builder Button
Expression Mode Button
The Expression Mode Button allows you to switch between different expression modes. The character on the button shows the mode that is currently effective. The modes are:
Mode | Button | Description |
---|---|---|
Constant Mode | Used for simple constant (literal) JavaScript expressions. Examples of constants are 50 or AskVicePresident. | |
Variable Mode | Used for JavaScript expressions that consist of a User Defined Attribute (UDA) or Application Variables or both. When you switch to this mode, a list is displayed that allows you to select the UDA or the Application Variables. | |
Expression Mode | Used for complex JavaScript expressions. A complex JavaScript expression might be composed of UDAs, operators, JavaScript functions and constants. The following is an example: "Process started" + uda.get("Description") With Expression Mode, you can type the JavaScript expression directly or build it using the Expression Builder. |
Expression Builder Button
The Expression Builder Button opens a dialog that helps you build complex JavaScript expression.
Expression Field
The Expression Field displays the JavaScript expression that you specify.
Expression Builder
The Expression Builder helps you create more effective and viable JavaScript expressions in less time and with less chance for making time-consuming hard-to-find errors. You can select expression building blocks from lists and add operators by clicking them. This is an easier and faster method of building JavaScript expressions, especially if you are unfamiliar with JavaScript syntax. Also, the Expression Builder has a built-in verification function that checks the validity of JavaScript expressions you have built before they are used.
The following figure shows the Expression Builder.
Figure 11.48 Expression Builder
The Expression Builder consists of the following parts:
Expression Display
This is where your JavaScript expression displays as it is built.
Verify Button
You can verify the validity of your JavaScript expression as you build it. Verification also occurs when you click OK. Invalid JavaScript expressions cause an error message that provides diagnostic information.
Operands area
In this area, you can select a JavaScript function or a UDA from the drop-down lists or type in a constant. Clicking Add adds it to your JavaScript expression.
Operators area
In this area, you can click an operator to add it to your JavaScript expression. The standard JavaScript operators are available.