Enumerations in Expressions

Last modified: February 13, 2024

1 Introduction

Enumerations are referenced by <modulename>.<enumerationname>.<enumerationvalue>.

For example, you have a module called OrderProcessing, in which an enumeration Status is defined with two possible values: started and completed.

To set the value of an attribute in a change list, object, or variable activity to completed, use the following input:

1
OrderProcessing.Status.completed

Conditional statements are also possible:

1
2
3
4
if 4>3 then
  OrderProcessing.Status.completed
else
  OrderProcessing.Status.started

2 getCaption

The getCaption function takes an enumeration value and returns the caption of this value. The caption is a translatable string and the result of this function depends on the current language.

2.1 Input Parameters

As an input parameter you can use an enumeration value of any enumeration.

2.2 Output

The output is described in the table below:

Value Type
The caption of the enumeration value in the current language. String

2.3 Example

If you use the following input:

1
getCaption($Customer/Grade)

The output can be:

1
Gouden

3 getKey

The getKey function takes an enumeration value and returns the key (called Name in Studio Pro) of this value. The key is the technical name for the enumeration value and is language independent. For more information, see Enumerations.

3.1 Input Parameters

As an input parameter you can use an enumeration value of any enumeration.

3.2 Output

The output is described in the table below:

Value Type
The key (name) of the enumeration value in the current language. String

3.3 Example

If you use the following input:

1
getKey($Customer/Grade)

The output can be:

1
Golden

4 Read More