This page is maintained for older versions of Rapise only. The latest documentation can be found at: https://rapisedoc.inflectra.com
Variables

Variables

RVL variables useful for storing intermediate results as well as accessing and passing global values to external JavaScript functions.

Variables may be used in Params to Conditions and in Actions.

Declaring and Assigning

This line declares variable without any values. Its value may be assigned later:

Flow Type Object Action ParamName ParamType ParamValue

Variable

MyVar1

This line and assigns value 5 to a variable MyVar2:

Flow Type Object Action ParamName ParamType ParamValue

Variable

MyVar2

number

5

If variable is declared earlier then assignment just changes its value. If variable is not yet declared then assignment is actually declaration with assignment.

Using

Any Params value may accept a variable:

... Type ... ParamName ParamType ParamValue

...

Param

text

variable

MyVar1

Any Params value may accept an expression using variables:

... Type ... ParamName ParamType ParamValue

...

Param

text

expression

MyVar2 + 4

Any Action may write its return value to a variable using Output statement:

Flow Type Object Action ParamName ParamType ParamValue

Action

Global

DoTrim

str

string

text to trim

Output

variable

MyVar1

Output value may then be as a param value in actions, conditions, assertions and expressions.

Local Variables

By default declared variables are assumed as local: variable may be used only within current RVL script and not visible from other RVL scripts or JavaScript code.

Global Variables

You may have a JavaScript variable defined in user Functions file (*.user.js), i.e.:

// Piece from MyTest1.user.js
var globalVar = "Value";

Then in the RVL you may declare globalVar as global and access it (read or assign values). Declaring variable as global is simple:

Flow Type Object Action ParamName ParamType ParamValue

Variable

Global

globalVar

Global variables are useful for exchanging sharing between different RVL scripts or between RVL and JavaScript.

Examples

Variables may be declared as Local or Global. Declaration may or may not contain initial value

Variable may accept output from the Action:

Variable may be used as input to the Action: