Using_Variables

last edited byusericonadmin on 13-Oct-2009

Variables are used throughout Saflets and the SafiServer. There are two scopes that variables can exist in: Current (aka Local) and Global


Contents

Current (Local Variables)

Current variables are variables that exist for the duration of a Saflet execution. These variables can be used in any ActionStep property that has a Dynamic Value Editor entry box (more information about the Dynamic Value Editor below).

Walkthrough: Adding a current variable

Current variables can be added and assigned a default value by using the Variables View pane. Right-click Current and select Create Variable:
VarViewPane

Enter you variable name, type and default value (optional). Press OK to add:
Create Var Box

Var ViewPane


Global Variables



Dynamic Value Editor

The Dynamic Value Editor is used for quickly adding values to a property field. Tabs in the Dynamic Value Editor allow for features like: variable selection, scripting, prompt selection, boolean editor, etc.

An Dynamic Value Editor enabled input box can be identified by a text field with extra buttons to the right the side of it:

Dynamic Value Entry Field
NOTE: A standard input field (text box without the extra buttons) is handled as a literal text input (i.e. you do not need to qualify text inputs with quotes)


Pressing the "..." button brings up the Dynamic Value Editor:
Dynamic Value Editor

Dynamic Value Editor Tabs

Variable Tab

The variable tab allows users to select a variable to use for the given ActionStep property. You can also add new variables by selecting the plus button, remove variables (minus button), or edit existing variables (pencil button).
Dynamic Value Editor: Variable Tab

Script Tab

The script tab allows for the entry of script (Javascript format) that will be processed in order to generate a value for the given ActionStep property. The last value in the script will be used for property value.

This example shows using a variable:
Dynamic Value Editor: Script Tab

Dynamic Value Editor: Script Tab

Bool Expression Tab

The Boolean Expression Editor is used for creating a statement that evaluates to true or false.
Dynamic Value Editor: Bool Expression Tab

Saflet Chooser Tab

Used for selecting a Saflet resource
Dynamic Value Editor: Saflet Chooser Tab

Download in other Formats:
markup Markup | pdf PDF | swf SWF | html HTML | word Word