Configuring Shared Variables

You configure a shared variable by providing the following:

  • a name for the variable

  • the schema of the data contained in the variable

  • optionally, an initial value for the variable

  • for Shared Variable resources, whether the variable is persistent and whether the variable should be available across process engines.

Setting the Schema of the Shared Variable

The Schema tab allows you to specify a complex schema for shared variable data. For more information about specifying data schema, see Editor.

Setting the Initial Value of the Variable

While configuring the shared variable, you can specify an initial value for the variable on the Initial Value tab. You can choose either None (no initial value), Select Value, or Build Value.

When you choose None, no initial value is set and the variable value must be set in a process definition before it can be retrieved. When you choose Select Value, you can choose a stored XML Instance resource containing data that matches the specified schema. When you choose Build Value, an Edit button appears that allows you to bring up a dialog to construct the initial value of the variable.

Making the Variable Persistent

The current value of the shared variable is stored in memory for efficient access by process instances. However, if a process engine crashes, the current state of the shared variable may be lost. To preserve the current state of a Shared Variable resource, you can check the Persistent field on the Configuration tab.

When a shared variable is persistent, its current state is written to the process engine storage location (either the file system or a database depending upon how the process engine was deployed). The current state of the shared variable is only updated in the process engine persistent storage when the value of the variable changes.

Note: The Persistent field is not available on Job Shared Variable resources, but the state of these variables is saved by a checkpoint. Therefore, it is not necessary to store these variables in a separate location in the process engine storage.

Sharing the Variable Across Multiple Process Engines

If you wish to make the value of a Shared Variable resource available to process instances across multiple process engines, you can check the Multi-Engine field on the Configuration tab. This field is not available on Job Shared Variable resources.

If you choose this option, a database must be used to store process engine data. Also, only engines that are in the same deployment and part of the same load-balancing group can share variables. For more information on specifying load balancing groups and specifying a database for process engine storage during deployment, see TIBCO ActiveMatrix BusinessWorks Administration. For more information about configuring a database for process engine storage within the testing environment, see Loading Processes to Test.

Because multiple process engines access the shared variable, the current value of the variable is not stored in memory. Both retrieving the current value of the variable and assigning a new value to the variable requires I/O to the process engine database storage.