SELECTVAL

Usage

TIBCO iProcess Workspace (Browser)

TIBCO iProcess Workspace (Windows)

Evaluates a conditional argument that returns data as a result of the Boolean type result (i.e. true or false).

Syntax

SELECTVAL (evalexpression, trueexpression, falseexpression)

where:

evalexpression (Boolean) is an expression to evaluate that returns a Boolean value.
trueexpression (vartype) is the expression result to return if the result of the evaluating evalexpression is true.
falseexpression (vartype) is the expression result to return if the result of evaluating evalexpression is false.
Note: Both trueexpression and falseexpression are evaluated so they should not contain any side effects. For example, in the following expression:

Both trueexpression and falseexpression are evaluated so they should not contain any side effects. For example, in the following expression:

num1:=SELECTVAL(a>b, casestart(proca), casestart(procb))

the value given to num1 is the result of one of the casestart functions (depending on the condition) but both the casestart functions are executed i.e. new cases of both proca and procb are started. This means you should avoid using functions like casestart where an action is performed as a result of the function.

Returns

The result data from the evaluation is either trueexpression or falseexpression. The return from the function is a Vartype.

Note: SELECTVAL and SWITCHVAL return Vartype. This means that SELECTVAL and SWITCHVAL can only be used as part of an assignment or in sub-procedure call definition and call expressions.

Examples

TIBCO iProcess Modeler:

Assign the contents of Field2 with the result of the SELECTVAL expression on Field1.

field2:= SELECTVAL (field1 = “New Patient”,1,0)

If Field1 does equal New Patient then 1 is assigned to Field2. If Field1 does not equal New Patient then 0 is assigned to Field2.

TIBCO Business Studio

field2 = IPEGeneralUtil.SELECTVAL(field1 = “New Patient”,1,0);