LSPS documentation logo
LSPS Documentation
Expressions

An expression is a combination of literals, data types, keywords, variables, function calls, operators, and calls to model elements that results in a single value; for example, "Hello " + getWorld() is a String expression that concatenates two strings: "Hello " and the string returned by the getWorld() function call. The getWorld() function is a model element and cannot be defined in the LSPS Expression Language; we assume, it returns the string "world!". The result of the expression is the string value "Hello world!". The interpretation is ruled by the precedence rules and associations.

Every expression exists in its own namespace and hence context; for example, the message property of a Log task exists in its own namespace, which exists in the immediate parent namespace. The expression namespace is a local namespace. More on namespaces in GO-BPMN is available in GO-BPMN Modeling Language Specification.

An expression namespace can define its local variables that can be used within the expression namespace. Note that you cannot define entities like functions, or custom data types in the language directly. However, you can make use of functions, model variables, custom data types, etc. defined in the model.

Block

An expression block represents its own namespace (implicitly if, then, else represent their own expression blocks): if you create a variables in an expression block, you cannot access from outside of it.

To create an expression block explicitly, start the block with the begin keyword and finish it with the end keyword.

//declaration of a local visibility variable
def Boolean visibility :=
//beginning a codeblock
begin
//declaration of a visibility variable in the codeblock (not available out of the block):
def Boolean visibility := false;
end;

Language constructs such as if, switch, foreach, while, for implicitly represent a block.

Literals

Literals represent fixed values. The notation of literals depends on the data type they represent. The notations are documented in Data Types.