TIBCO BUSINESS WORKS VIDEOS

TIBCO BUSINESSWORKS ONLINE TRAINING, VIDEO TUTORIALS

Blog

How to: Quickly Edit Global Variables in TIBCO BW Designer

Posted by karthik on October 25, 2011 at 12:15 AM

 


Version of Designer used: 5.5.2.2

 

Global Variables (GVs) are one of the most important bits of any BusinessWorks project. Every project will have at least one set of GVs, usually to store certain settings centrally. GVs also allow those settings to be changed on a running application without having to re-archive and re-deploy it.

 

A common usage scenario (which I will be using as an example as well) for GVs is to store connection settings for the EMS server. Basic set of connection settings for say a JMS Connection resource would be the Username and Password information and the JNDI information.

 

As it is very important to structure the GVs properly for easy reference and maintainability you should make good use of Groups. A common way of structuring GVs is to use the location path as a group.

 

For example if your JMS Connection resource is in /MyProject/Connections/JMS/ folder then you would create three groups. A main group for all the project GVs called MyProject, below that a sub-group for all Connections in your project and below that a group for all JMS connections and so on.

 

But if you have tried to use the GV editor in Designer and have been frustrated with forever expanding and collapsing nodes, re-sizing the window and not being able to copy-paste stuff then you will know what a nightmare it is to create complex group hierarchies. Don’t you wish you could just edit an XML file and create those GVs instead of using the built-in GV editor in Designer.

 

Fear not though, there is a quicker and easier way of creating and edition GVs (otherwise no point in writing this post

 

Lets start with a blank canvas so as to say. Open up the Designer and navigate to the Global Variables tab (see image below). Click the yellow pencil button to bring up the dreaded built-in GV editor.

 

 

 

Let us say we want to create a complex hierarchy of groups and values but we want to do it without getting frustrated with the built-in GV editor. It is possible to achieve this using the Windows Explorer (or the Linux equivalent) along with a text-editor (even Notepad will do but I prefer Notepad++ as it has XML support).

 

Basic Concept

 

Before we start the editing process it is important to understand how the GVs are stored in a project. One would have thought there would be a file with the GV hierarchy and values which we could edit. That thought is partially correct.

 

The main thing to understand is that every GV Group is a folder within the Global Variable root folder (more on this later). Furthermore every GV is an entry in a simple text file within the folder of the Group it belongs to.

 

Locate the Global Variable Root Folder

 

Open up your Windows Explorer and navigate to your TIBCO Designer Workspace folder. There navigate to the project for which you want to create GVs. Within the project folder there should be a folder called ‘defaultVars’. This is the ‘root’ folder for your global variables.

 

In the example the project name is WebServiceTest and the path is: [TIBCO Workspace Folder]\WebServiceTest\defaultVars

 

DefaultVars.substvar File

 

Within the ‘defaultVars’ folder you will find a file named defaultVars.substvar. This file can be opened in any text-editor and it contains all GVs belonging to the ‘root’ Group.

 

If you open this file in a text-editor you will find that it contains XML data. For the above set of GVs (see image) in the ‘root’ Group you will see entries like:

 

JmsProviderUrl

tcp://localhost:7222

true

false

String

1282736878059

JmsSslProviderUrl

ssl://localhost:7243

true

false

String

1282736877974

RemoteRvDaemon

true

false

String

1282736878048

 

From the above listing we can see that each GV has its own globalVariable element. There are several child elements present for each global variable:

 

Name - is the ‘name’ of the GV which is also displayed in the Global Variable tree (see figure above).

 

Value - is the actual value of the GV.

 

DeploymentSettable - GV can be set during deployment.

 

ServiceSettable - GV is settable at per service level. Used for TIBCO Adapter archives.

 

Type – Data type of the GV. Possible data types: String, Integer, Password and Boolean.

 

ModTime - Time GV was modified.

 

So the root variable JmsProviderUrl is represented as:

 

JmsProviderUrl

tcp://localhost:7222

true

false

String

1282736878059

Example Now if we want to create a new set of GVs for a JMS connection with the location WebServiceTest/Connections/JMS then we need to first create the folder structure within the root folder which will give us the corresponding Groups in the Global Variables tab. The folder structure will now look like below: Next we need to add some GVs to the JMS group. To do this go down to the JMS sub-folder and in there create a defaultVars.substvar to store the GVs. Make sure the extension of the file is .substvar. Next open this file in a text-editor and add the following tags:

 

 

All variables will be defined within the globalVariables tag.

 

Next we create two GVs one for storing the EMS username (JMS_Username) and one for storing the password (JMS_Password) as below:

 

JMS_Username

User

true

false

String

1282736878069

JMS_Password

Password

true

false

Password

1282736878069

 

Save and close the file. Then close and reopen the project in Designer (required to refresh the Global Variable tab).

 

After reopening the project if you go to the GV tab you will see the following:

 

As you can see the two GVs we created in the file are now ready for use. Also notice each of the folders we created within the defaultVars root folder is shown as a Group.

 

Using this method you can also copy-paste GVs for things like JMS Queue Receiver and Senders to create separate set of GVs for different processes and/or services.

 

Example project: http://www.fisheyefocus.com/GVTest.zip

 

Overview with the created GVs on the left hand side and the JMS connection using one of the GVs on the right hand side:

 

 

The project running:

 


Categories: None

Post a Comment

Oops!

Oops, you forgot something.

Oops!

The words you entered did not match the given text. Please try again.

Already a member? Sign In

10 Comments

Reply Ajeet
2:12 AM on May 30, 2014 
Hi,
Very good article.
One question I want to ask about the BW designer, how can I download this?
Thanks in advance.
BR,
Ajeet
Reply Michaelnob
4:08 AM on October 11, 2017 
http://levitrafromuzaz.com - venta de tadalafil
, hello and buy!, hello and buy!
Reply Michaelnob
6:02 AM on October 13, 2017 
http://onlinenewpharma365.com - clomiphene citrate dosage for pcos
, hello and buy!, hello and buy!
Reply Michaelnob
7:18 AM on October 13, 2017 
http://onlinenewpharma365.com - drugs pharmacy 1YV5
, hello and buy!, hello and buy!
Reply KelStax
12:27 AM on August 28, 2019 
Como Comprar Cialis Discretamente generic cialis Reaction To Amoxicillin And Mononucleosis
Reply Tartinbah
10:25 PM on February 10, 2021 
cialis 10mg
Reply chloroquine over the counter uk
12:27 AM on February 14, 2021 
who makes chloroquine phosphate buy chloroquine online does chloroquine work
Reply long term side effects of plaquenil
2:51 PM on February 18, 2021 
erectile vasectomy plaquenil brand name causes of erectile dysfunction
Reply plaquenil sulfate
6:03 PM on February 21, 2021 
hydoxychloroquine hctz hydrochlorothiazide how do i get hydroxychloroquine
Reply buy online zithromax
6:23 AM on February 24, 2021 
azithromycin and zithromax zithromax buy online what is zithromax 250 mg used for