Академический Документы
Профессиональный Документы
Культура Документы
Enterprise
Application
Integration
Author:
Ranjeet Singh
Confidentiality Statement
This document contains information that is proprietary and confidential to Tata Consultancy
Services. Any use or disclosure in whole or in part of this information without express written
permission of Tata Consultancy Services is prohibited.
Any other company and product names mentioned are used for identification purposes only, and
may be trademarks of their respective owners.
Copyright 2007 Tata Consultancy Services (TCS).
JavaCustomFunction Palette
Confidential
JavaCustomFunction Palette
Contents
Introduction
Step By Step Procedure to create a Java Custom Function
List of Softwares Required
Conclusion
Confidential
4
5
10
10
JavaCustomFunction Palette
Introduction
The Java Custom Function resource allows you to create custom functions to use when mapping
data in an activitys input tab. These functions are also displayed when using the XPath Editor to
build an XPath expression. To create a custom function, you must write the function as a method
of a Java class and compile the code into a Java class file. You then load that class file into the
project using this resource. When the class is loaded using this resource, TIBCO ActiveMatrix
BusinessWorks inspects the contents of the class and only the class methods that meet the
following restrictions are made available in XPath:
The input parameters and return values must be of one of the types described in
If you make references to any imported class files, these classes must be
available in the classpath configured for TIBCO ActiveMatrix BusinessWorks.
The easiest way to make the imported classes available is to place them in the
TIBCO/bw/2.0/lib directory.
Confidential
JavaCustomFunction Palette
package com.tibco;
public class Concat {
public static String CustomConcat(String first,String
second)
{
return first + second ;
}
public static void main(String args[])
{
System.out.println(CustomConcat("Ranjeet ","Singh"));
Confidential
JavaCustomFunction Palette
3. To add this java function under Xpath library, copy the class file and put it under
C:\tibco\jre\1.5.0\lib ( tibco bw library path).
4. Now open designer.
5. Use a JavaCustomPallete and give the path of above class file. Load the class file once.
This is one time activity. Once class file is loaded , next time we need to load it again. The
class file can be moved or deleted from OS level/path. But class file must be present
under bw library path.
6. There is another way of referencing the class file. Give the path of class file in
designer.tra and bwengine.tra files as we do for any java class file when we intent to use
them in BW.
Confidential
JavaCustomFunction Palette
8. Use Xpath expression for mapping the param field under root node.
Confidential
JavaCustomFunction Palette
9. Our custom java function CustomConcat has been added to the default list of Xpath
function builder.
Confidential
JavaCustomFunction Palette
11. We should get concated value as output as shown in the screen above.
Conclusion
Java Custom Function palette can be used in a scenario where tibco does not provide XPATH
function for any of our requirement. This is also be used in case when we have some reusable
function that need to be implemented across the whole project.
Confidential