SQL Components as Instance Variables

You can use cataloged SQL table components as process instance variables. This is useful when you want to persist data associated with a process instance into a separate database.

Unlike any other component types, the Process Execution Engine treats process instance variables of a SQL table component type in a special way.

When the Engine completes the execution of a transaction on a process instance (most commonly, the execution of a process activity) the Engine persists the state of all instance variables on its runtime database. However, for those instance variables of a SQL table component type, the Engine only persists its primary key attributes.

When you access the attributes of a SQL table object used as instance variable, the component automatically loads its attributes from the database. Refer to Using SQL Components for details on how SQL components are auto-loaded.

This special behavior for SQL table components provides the following benefits:

Disabling special handling of SQL components

You can disable this behavior by setting the accessDatabase attribute of the component to false.

When attribute accessDatabase is false on a SQL component used as a process instance variable, the Process Execution Engine persists the complete state of the variable, including all primary key and non-primary key attributes.

When attribute accessDatabase to false, auto-loading is disabled. Refer to Using SQL Components for details on how SQL components are auto-loaded.

  // "customer" is a process instance variable of
  // SQL table type "CUSTOMER"
  this.customer.accessDatabase = false

  //... from now own, the Engine stores the complete state of
  // "customer" variable, including non-primary key fields.
  // Auto-loading is also disabled for this variable.