Configuring Process Variables

Image:mapping_node_inputs_and_outputs.png

A process variable is a place-holder for data that can be accessed throughout the lifecycle of a process. It is how data is transferred between nodes in a model. Node inputs are mapped to process variables on either the Data Tab or the Setup tab of each activity or smart service.

  • For example, if you have a node that uploads a document, you can store the document ID in a process variable called uploadedDoc. Later in the process, if you can have a node that sends an email, you can have that node reference the uploadedDoc process variable and use the data to send an email with a link to the uploaded document.

Process variables can also be used similar to how formulas use spreadsheet cells to calculate values. See also: Variables in Expressions.

NOTE: Appian process variables, node inputs, and node outputs are strongly typed, so they are configured to hold and represent only certain kinds of data. For example, a document process variable contains an integer that represents the document ID of a file stored in Appian Document management.

See also: Data Types

Creating a Process Variable

  1. In the Process Modeler, select File > Properties.
  2. Click the Variables tab.
  3. Click Add Variable.
    • The Edit Process Variable Dialog Box displays. Image:edit_process_variable_wizard.gif
  4. Configure the following properties:
    • Name: Enter a name for the process variable. Only letters, numbers, and underscores are accepted.
    • Type: Select the desired data type (such as User, Group, Document, or Text) from a list by clicking the Browse button. Process variables must take a data type.
    • Value: Enter a default value for the variable.
      • If the process variable has a complex structure, you must use an expression to set the default value. Type the value of each element inside an array separating each value using commas. For example, ={AddressLine:"1060 W Addison St.",PrimaryCity:"Chicago",CountryRegion:"IL",PostalCode:"60613"}
      • Values that you manually enter may be capped by a system restriction on entering text.
      • When entering a Number (Decimal) data type, make sure to enter a value supported by double precision floating-points. If you enter a number that exceeds the maximum number of digits supported by double precision floating-points, the number is truncated down to the maximum number of digits when you save the process model. It does not provide you with a warning message if this occurs.
      • When entering a Number (Integer) data type, make sure you enter a value between -2,147,483,647 to 2,147,483,647 (or from -231+1 to 231-1 in scientific notation). If you enter an integer outside of this range, the integer will be replaced with null when you save the model. It does not provide you with a warning message if this occurs.
      • If the default value of a variable is used as a Parameter and is defined using an expression, that expression is automatically used as the default value for any associated fields in a process start form. The reverse instance is also true. Expressions used as default values on start forms are used to calculate the parameter's value.
    • Parameter: Select this checkbox if you want the variable value to be entered when the process starts using a Process Start Form.
      • Creating a parameter process variable with a primitive system data type automatically adds a field to the process start form, which is automatically mapped to the process variable. This does not occur when a process variable is created with a complex or custom data type. The Process Start Form cannot be used to populate process variables with a complex or custom data type.
    • Required: Select this checkbox if you want to require the parameter to have a value before the process starts. You can specify a default value if the user input should be optional.
    • Multiple: Select this checkbox if you want to store an array of values.
      • When typing a process variable's default value directly in the field, use commas to separate the items. For example, "a","b","c","d".
      • If entering the array as part of an expression, see also: Arrays in Expressions.
      • When defining a process variable using a query rule, the process variable must accept multiple values, unless you expect the query rule to return only one record.
    • Hidden: Select this checkbox if you do not want the variable's values to be used in reports that use this process or process model as the context or available for mapping to parent processes when the process model is used in a Sub-Process Activity.
      • You can not make a variable hidden if it is a parameter.
      • Changes to hidden variables do not appear in the process history.
      • To expose the process variable within newly started process instances, clear the Hidden checkbox.

See also: Process Start Form and Sub-Process Activity

Process Variables from Query Rules

The Value of your process variable can be defined using a query rule.

The data type of the entity used for the query rule and the process variable must be the same.

Image:Data_store_entity_data_type.gif

See also: Query Rules and Data Stores

Process Variables from Process Properties

The Value of your process variable can be taken from a process property, such as the Process ID.

Process properties do not appear in the expression editor at design time (as there are no active process instances); however, you can reference them by name in your expressions.

See also: Process Nodes

Changing Process Variable Names

Changing the name of a process variable in the Process Model Properties dialog box automatically changes the name of the variable in the instances listed as automatic in the following table:

Process Variable Usage Automatic Versus Manual
Expressions Manual
Conditions Manual
Rules Manual
Custom node output expressions Manual
Node input mappings Automatic
Node output mappings Automatic
Variables displayed as default form values Automatic
Expressions used to calculate default form values Automatic
Gateway conditions Automatic

If you change a variable's name, you can view each place the variable is used that requires a manual change by clicking the Validate button. The missing process variable triggers validation errors, which you can click to display the dialog box where the rule or expression can be edited to use the new variable name.

See also: Updating Process Model Properties

Reporting on Process Variables

Process variables often serve as the basis for report data.

See also: Creating a Report

FEEDBACK