Process variables

Variables are integral to the setup and creation of a business process. A variable is a storage location for values that are retrieved at runtime. Variables are used to store and transport data from one activity to another. They are also used to determine paths of execution.

A variable name must start with a letter and cannot contain spaces.

Use process variables to store data for a specific process. Process variables hold values for items that change during the execution of a process. They are local (private) to the map for which they are created. Process (and case) variables can be simple (1 value) or complex (an array of values). See Create complex variables for more information.

In TotalAgility, you can create process variables of type Bool, Byte, Currency, Date, Decimal, Double, Float, Long, Short String, Nullable Date and Nullable String. TotalAgility also supports the following type of variables:

Checklist

A checklist variable is a process variable used to hold checklist information for quality checking and sampling. A single checklist variable can contain several checklist items. See Create a checklist variable.

Complex

Use a complex variable to hold tabular or array-based data values, such as a list of product details. Two kinds of complex variables are available:

  • Static Complex: Static Complex Variables are an array (group) of variables of potentially different data types. Static complex variables keep their cell mappings to process variables throughout the job. See Create a complex variable.

    Note A static complex variable can only be created for a process; it cannot be created as a server variable.

  • Dynamic Complex: See Dynamic Complex Variables.

Data Backbone

A Data Backbone variable is a variable that maps directly to a project within a selected CCM (Customer Communications Manager) server and gives access to the data backbone belonging to that project to get or set data in it. Each CCM project consists of one data backbone. The data backbone exposes all the data required to create documents in that project.

A data backbone is an XML structure containing field sets with single fields and nested/repeating data. For example

[Company Details]
Company Name
Address
   Street
   Postcode
   Country
     Code
     Name
[Director Details]
<List of Directors>
      Director Name
      Director Address
            <List of prior addresses>

Only single fields can be used directly within a process. Custom code is required to set the more complex and repeating data.

You can expand the variable in the Consume window to see the fields. When a field is consumed, the level from where it came, is also displayed. For example, if you use the Country Name from the preceding example, then the syntax is: <VariableName>.Address.Country.Name.

You can set the data field by field (single fields only) or use a service call to populate the entire structure. For example, you can populate the variable by getting data from a database, or you can pass the value of a field into a business rule and update a different field using the result.

Within CCM, you can add new fields to the data backbone, but cannot delete existing fields. You must refresh the project in CCM integration to view the newly added fields.

You can create multiple variables of this type, each pointing to the same or different projects.

Document

Use Document variable where one document type is required, such as submitting a proof of address later in the bank application process. Using a Document variable, one instance of a document is added to the repository typically of a known type.

Use Document variables to use document instances in a TotalAgility process or business rule.

Use a document variable as a process initialization variable or as an activity input or output variable. You can also use document fields directly as input or output parameters to an activity.

When you create a job on a process that uses a document variable, the runtime instance ID of the document is stored in the document variable.

See Create a document variable.

Dynamic Complex

Dynamic Complex Variables keep their cell mappings to process variables only until they are updated in the job. They are stored against the job and their array size and values can change during the course of the job. They can also be created as a server variable. See Create a dynamic complex variable.

At design time, you can create a complex variable with a maximum of 1000 cells, such as1000 X 1, 500 X 2, or 5 X 200. However, at runtime, no maximum limit is placed on the number of cells.

You can create dynamic complex variables at the server or process level. Both types of variables are created in the same way. However, the Process Initialization option is not available when setting up complex server variables.

Variable members can be either dynamic or static. A static value is one that a user can enter but cannot modify.

Folder

Use a Folder variable where multiple document types are required, for example, bank application where multiple document types are required to process an application. Using a Folder variable more than one document is added to the repository typically of different types. Use Folder variables to use folder instances in a TotalAgility process or business rule.

Use Folder variables to use folder instances in a TotalAgility process or business rule.

When you create a job on a process that uses a folder variable, the runtime instance ID of the folder is stored in the folder variable.

You can use a folder variable as a process initialization variable or activity input or output variable. You can also use folder fields directly as input or output parameters to an activity.

See Create a folder variable.

JSON Expression

Use a JSON (JavaScript Object Notation) Expression variable to retrieve data from a JSON string as per the expression text (JSONPath).

JSONPath is the expression type of the JSON Expression variable. It uses special notation to represent nodes and their connections to adjacent nodes in a JSONPath path. A JSONPath expression can use any of the following styles of notation:

  • Dot notation. Example: $.store.book [0].title

  • Bracket notation. Example: $ ['store'] ['book'] [0] ['title']

    The dollar sign ($) represents root member object.

You can also use the following basic operators:

@

To select current object.

.

To select child objects.

[ ]

To filter array objects (you can either put a number to select single item or a predicate to filter out selected item/items).

?()

To place expressions that can be used as predicates.

..

Recursive descent, to select objects at any level below (not just current level).

Note
  • You can set JSON Expression variable as input and output to an activity.

  • You can create multiple variables of this type, each variable pointing to the same or different source JSON.

  • TotalAgility does not support arrays of JSON string from the expression path.

The following table displays sample JSONPath expression and the data retrieved.

JSONPath

Result

$.store.manager.name

The name of the store manager.

$.store.book[0].name

The name of first book.

$.store.book[ ?( @.isbn == 'isbn1' ) ].author.name

The name of the author of book with isbn - isbn1.

See Create a variable of JSON Expression type.

System

These are simple non-editable process variables that give you information, such as who created the job and, the job ID which you typically do not know at design time.

Each System variable holds a value for a specific TotalAgility task. For example, SPP_RES_JOB_Creator holds the User ID of the creator of a job, or the AWF_JOBID holds the ID of the job. This information is only gathered upon job creation. See Add a system variable to a process.

XML

Use an XML Expression variable to use all or part of the XML document.

To use a part of the document, you must create an XML expression to identify the required section of the document.

XML documents can be represented as tree view nodes, and the XML Path Language (XPath) describes a path through the XML document to select elements that match the path.

Note The XPath is the expression type of the XML expression variable. For example, to select the first number element of the XML document, the XPath is:"//number" or to select all the book nodes under the bookstore element, the XPath is: xmlDoc.selectNodes("/bookstore/book")

You can create an XML expression at the server or process level; the process is the same for both.

  • An XML expression created at the server level can be shared between business process maps, where the same XML is used but for different purposes.

  • An XML expression created at the process level can only be used with the process map for which it is created, and the XML expression is local to that process map.

See Create an XML variable.

XML Expression

Use an XML Expression variable to use all or part of the XML document.

To use a part of the document, you must create an XML expression to identify the required section of the document.

XML documents can be represented as tree view nodes, and the XML Path Language (XPath) describes a path through the XML document to select elements that match the path.

Note The XPath is the expression type of the XML expression variable. For example, to select the first number element of the XML document, the XPath is:"//number" or to select all the book nodes under the bookstore element, the XPath is: xmlDoc.selectNodes("/bookstore/book")

You can create an XML expression at the server or process level; the process is the same for both.

  • An XML expression created at the server level can be shared between business process maps, where the same XML is used but for different purposes.

  • An XML expression created at the process level can only be used with the process map for which it is created, and the XML expression is local to that process map.

See Create a variable of XML expression type.

Process variable examples

Variable Name Type Value
CUSTNAME String JuliaR
CUSTADDRESS String Hollywood
AMOUNT Double 100000
Approved Boolean True

The System requires initial information for a process to run. For example, to process a loan application, customer details and the loan amount are required. This information is provided by declaring the initialization variables. In this case, you would create process variables such as customer ID, customer name and loan amount, and then declare the loan amount as the initialization variable.