Defining and Using Shared Variables

Shared variables are defined at a module level.

Defining a Shared Variable

Procedure

  1. In the Project Explorer view, double-click Shared Variables under the Module Descriptors to open the Shared Variables tab.
    Two panes are displayed:
    • Module Shared Variables
    • Job Shared Variables

    For more information, see "Shared Variables" section in the TIBCO ActiveMatrix BusinessWorks™ Concepts guide.

  2. Click one of the following icons in the respective sections to define a module shared variable or a job shared variable:
    • - Add a complex element. You can choose from an existing schema declaration or create a new schema.
    • - Add a simple element.
    • - Select the Shared Module where the reference to the shared variable needs to be updated.
  3. In the Properties view, provide the information as described in the following table.
    Tab Field Name Description
    General Variable Name Name of the shared variable
    Type After adding a complex or simple element, specify the Module Data type for the shared variable to use by selecting one of the following options from the drop-down menu:
    • String
    • Integer
    • Boolean
    • Date&Time
    • Complex Element...
    Persistent

    By default, the value of a module shared variable is stored in memory and the current state of the module shared variable would be lost in case the engine (or the AppNode) crashes.

    Select the check box to persist the current value of the module shared variable. The current state of the variable in the engine's persistent storage is only updated when the value of the variable changes. Also, a persistent module shared variable can be made visible across AppNodes in an AppSpace when the engine persistent mode is set to "group".
    Note: The engine persistence must be configured for the current value of the module shared variable to persist.
    Note: This check box only displays when configuring module shared variables. Job shared variables cannot be configured to be persistent.
    Description Description Description for the shared variable.
    Initial Value Initial Value Enter an initial value for the shared variable. Select one from the following options:
    • None: Specifies that no initial value is set for the shared variable. Ensure that you set the value using the Set Shared Variable activity in the business process before you retrieve the value of the variable using the Get Shared Variable activity.
    • Select Value: Select this option to browse and select a file containing the initial value for the shared variable.
    • Build Value: Select this option to enter an initial value for the shared variable.

Retrieving and Assigning a Value of a Shared Variable

To retrieve the value of a shared variable, use the Get Shared Variable activity in the General Activities palette. To assign a value to a shared variable, use the Set Shared Variable activity in the General Activities palette.