TIBCO BW6 Application Version

Versioning is very important within TIBCO BusinessWorks 6.x (BW6).

One approach to managing EAR file versioning is to incorporate the version into the EAR file name. For example, ApplicationName.application_1.0.0.

However, there are limitations to this approach.

  • you are dependent upon the accuracy of the person or process that created the EAR file and named it
  • it doesn’t include the qualifier portion of the version
  • if you are using a version control system for the EAR file then you don’t want the file name to change between versions

Luckily, EAR files follow the same standard as JAR files. The following code snippet will query the EAR file for the “Bundle-Version” and output it

import java.io.IOException;
import java.util.jar.*;

public class EarVersion {
   public static void main(String[] args) {
       JarFile jf = null;
       Manifest mf = null;
       Attributes att = null;
       try {
           jf = new JarFile(args[0]);
       } catch (IOException e) {
           e.printStackTrace();
       }

       try {
           mf = jf.getManifest();
       } catch (IOException e) {
           e.printStackTrace();
       }

       att = mf.getMainAttributes();

       System.out.print(att.getValue("Bundle-Version"));
   }
}

If you run this against an EAR file you will get an output that looks like 1.0.0.2019030110473, assuming that the application Version: (in TIBCO BusinessStudio for BusinessWorks) is set to “1.0.0.qualifier”.

You can use this in the following Windows command script to set a variable with the major.minor version number. (This example assumes that you generated the ear-version.jar file from the code snippet above and that your TIBCO HOME is c:\tibco.)

SET JAVA_HOME=c:\tibco\tibcojre64\1.8.0
SET PATH=%PATH%;%JAVA_HOME%\bin
FOR /F “usebackq tokens=1-2 delims=.” %%G IN (java -jar ear-version.jar %appname%.ear) DO set appversion=%%G.%%H

The value of the variable appversion would be 1.0 for a full version value of 1.0.0.2019030110473.

The application’s major.minor version number is required for the following common bwadmin operations.

  • backup
  • start
  • stop
  • undeploy

A deployed application’s major.minor version number can also be queried using the following Windows command script.

cd /d c:\tibco\bw\6.5\bin
FOR /F “usebackq tokens=2” %%i IN (`bwadmin show -d %domain% application ^| findstr %appname%`) DO set appversion=%%i


Leave a Reply

Your email address will not be published. Required fields are marked *