Tibco Tutorial Tibco Variables

Tibco: Shared Variable

In this tutorial we will learn how to configure and use Shared Variable.
Shared Variable
In this a single slot of memory is allocated to store the data which is used by all process instances to read or update. Thus every new instance will have access to the updated set of information.
In this tutorial we will create a BW process as shown in the images below.

1.1 First Create a Shared Variable
Configuration Details

Configuration Tab

Persistent: By checking this property the data is stored in the process engine’s storage location (configured in tra file). In case the BW engine is restarted the stored data is not lost.
When unchecked in case of BW restart or crash the stored value my be lost.
Multi-Engine:By checking multiple process engines can access the stored data.

Schema Tab

Initial Value Tab

Build Value: Used to predefined the values to be stored in variable. Here we are setting it to 1.

1.2 Create below design with specified configuration

Design


Start Pallet Configuration

Output Editor Tab


GetVariable Configuration

Configuration Tab

Variable Configuration:
Specify the Shared Variable resource which we have created above.

SetVariable Configuration
Configuration Tab

Variable Configuration:
Specify the Shared Variable resource which we have created above.
Output New Value:
The activity will output the latest updated value in the output tab.

Input Tab

1.3 Pre-run configuration

Before running the BW process we need to set the input as “5” to the starter activity. We can do this by selecting the Start process and hit F12. The below dialog will open.1.4 Running Bw process

On running the BW process for first time the GetVariable activity will get the predefined value as “1” and SetVariable will set the value as “5” in Shared Variable.
Re-set the Start activity value to “15”
On running the BW process for the second time the GetVariable will get the updated value from Shared Variable that is “5”.

Every new process instance created will get the latest set value.

Note: If we will stop BW process testing and re-run it, the value fetched by GetVariable will the last updated value “15” before stopping the process instead of predefined value “1” since we are using persistent property in Share Variable.

Varun Goel

About Varun Goel

Varun Goel is a technology enthusiast with 6+ years exp in IT industry. In fact, he is been developing application after schooling as freelancer. Currently working with one of the Fortune’s 100 Companies having vast experience Mule ESB, Tibco, HTML5, CSS, JSS, Android, Core Java, JSP, PHP, MySQL, AutoCAD, Maya, ZBrush, Photoshop, Flash CS and many more.

3 comments

  1. Pawan Munipalli

    How to save shared variable in local under. TIBCO/working…

    When I am using designer in local shared variable is not getting saved under the path. To achieve that do I need to do any additional configuration or waitstill system get crash…

    TThanks in advance,
    Pavan

    1. Varun GoelVarun Goel Post author

      Hi Pawan,
      There is no additional changes or configuration required to run shared variable locally. I have corrected a image under Shared Variable configuration tab, please check and it should work now. Please let me know if you are still seeing the same error.

Leave a Reply

Your email address will not be published.