Process variables and data types


A process consists of input and output variables (or parameters) that you can configure depending on the purpose of your process. You can configure the process variables of different data types such as Boolean, Date, Date/Time, Decimal, Floating, Integer, Object, Record, Selection, Text, Time, and Document.

Types of process variables

The following table describes the process variables in detail:

Parameter

Description

Input variable

Parameter values that you need to provide when starting a process instance.

  • When you add a required input variable with the Text data type or the Record data type, the context key for the process is set automatically.
    A context key gives a business reference to a process instance and is an identifier for a process instance. When you look at the process instance in the Manage Processes dashboard, you can quickly identify the process instance, and relate the process instance to the business use case. For example, an Approval Process with a context key as HPD0002340 indicates that the Incident request HPD0002340 started the Approval Process.
  • If a process instance has multiple required input variables, the first input variable is used as the context key.
  • If a process does not contain any required process variables of data type Text or Record to start the process, a context key named instance is automatically added at the process runtime. The context key is displayed in the Manage Processes dashboard.
  • If you have multiple required input variables and you delete the input variable that is used as the context key, the context key is assigned to the next suitable input variable.

Output variable

Parameter that a process instance returns on process completion.

Variable data types

The following table describes some data types in detail:

Data type

Description

Record

Use the Record data type to hold a record instance. For the Record data type, a parameter is passed by reference. When a parameter is passed by reference, the caller and the receiver use the same variable for the parameter. If the receiver modifies the parameter variable, the effect is visible to the caller variable.

  • If the record data type is used as a process input parameter and a record instance is updated by the process, the caller automatically receives the updated record instance when the process returns. You do not need to define the record as the process output parameter to receive an updated record instance.
  • If you want to share a process by using different record definitions, you can use Sample Record Definition to associate a record data type to more than one record definition.
    • To use the Sample Record Definition, on the Add/Remove Variables window, add a variable, select the data type of the variable as Record, and select Use Sample Data.
      You can use Sample Record Definition to refer to the record fields. However, the record definition name of the record is not validated at the process runtime. A null value is used  if a record instance does not have a field referenced by a process. 
  • We recommend that record definitions that share the same process definition are inherited from the common base record definition. When you use Sample Record Definition, it is the base record definition, which ensures all fields referenced in the process definition are available to all the inherited record definitions. For more information about record inheritance, see Inheriting-an-existing-record-definition-to-a-new-record-definition.

Object

Use the Object data type to hold an object. For the object data type, a parameter is passed by value. When a parameter is passed by value, the caller and the receiver have two independent variables with the same value. If the receiver modifies the parameter variable, the effect is not visible to the caller.

(Optional) Object associated with Document

Use a Document to hold a JSON schema for an object. When you associate a document with an Object type variable, you can expand the Object variable according to the Document schema and use the individual attributes, such as a simple object, nested object, or array of objects, in a process expression. For more information, see Defining-a-document-schema.

The following images demonstrate how to access individual attributes within a simple object or an array of objects.

Accessing attributes in a simple object:

22_1_Accessing simple objects.png

Accessing attributes in an array of objects:

22_1_Accessing array of objects.png

Important:

  • You must use a multi-instance loop to access all the elements in an array.
  • You can associate an Object with a document only if the runtime assigned value to an Object is in JSON format.

List

Use this composite data type to create a list of primitive data types. Currently, you can create a list of only attachment and text data types.

You can also use the List type of variable in a multi-instance loop to iterate its elements. To populate a list, you can also use the Create List element.