Tibco BW- Using Jar files

If you want to use external java classes in your BW project, you can create a jar file and use it within Project

Create a New Alias

–  Create New Alias Library (for example, TestAlias)
–  Select Alias TAB
–  You can add external jar in two ways

  • You can create a new Alias (+ sign)
  • You can select Alias Picker (from File Alias)- Here you can choose alias which are included in your file alias (for example, abcd.jar). In order to use it you must have file alias for the jar file

Create new Java Global Instance
–   Create new Java Global Instance (for example, TestGlobalInstance) with following values

  • Library- select alias created above.
  • Class- Select a class (when you click on search button you will be shown jar file). If you are not able to see jar file, please follow instruction provided.
  • Method- select method to call

–   You will be shown all parameters required for the method.

Using Java Global Instance
–         Create a new process
–         Drag Java Method from Java palette
–         Select Java Global instance created above (for example, TestGlobalInstance)

  • You could use any other method of class selected in Java Global Instance. You would not be able to change a class here

Using Alias Library
–         Alias can be directly used within Java method (From Java palette) with following values (Keep Java Global Instance value empty in Java Method)

  • Library- select Alias library
  • Select a class and method to be used


When you use Alias Library and Java Global Instance

 
Java Global Instance-

  1. You are sure which class to use, but you may want to use different method during BW process.
  2. You may want to restrict classes to be used within BW processes

Alias Library-

  1. This gives to immense flexibility in using jar file.
  2. You can select one or more jar file as part of Alias Libray and different processes can reuse it.
  3. They may want to different java classes and their method.

Leave your comments below, if you find this article useful.

Tagged with: , , ,
Posted in Java

Leave a comment