Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 5 TIBCO ActiveMatrix BusinessWorks: Demonstrating Custom Function Callout : Set up the Custom Function Callout Example

Set up the Custom Function Callout Example
Task C Preparing the Custom Class
Before starting the example, you must import the sample project zip file and save it in a new project.
1.
The first task is to write the custom function. This can be done by implementing the KenanMessageHandler interface exposed by the adapter. In this example, two custom classes, AcctCustomMessageHandler.java and KenanCustomMessageHandler.java have been provided in $TIBCO_HOME/adapter/adkenan/<version_num>/examples/KenanCustomCallOut/CustomClasses. The custom logic is to be written under the method declared as processMessage.
2.
The next step is to prepare the custom function handler factory class. This can be done by implementing the KenanMessageHandlerFactory interface exposed by the adapter. In this example, KenanCustomFactory.java has been provided. The purpose of the factory class is to instantiate the custom function handler class. In this example, KenanCustomFactory.java has been provided in $TIBCO_HOME/adapter/adkenan/<version_num>/examples/KenanCustomCallOut/CustomClasses. The logic for instantiating the custom function handler has to be written under the method declared as getMessageHandler.
Perform the steps 1 and 2 only if you wish to create your own Java classes. The above steps are not required if you are using the Java source files provided with the adapter installation.
In case you want to use the source files provided with the adapter installation, provide a valid account internal ID in the following entry present in the processMessage method body:
3.
Once the source files of both the classes have been generated, the same have to be compiled. setenv_customcall.sh (in $TIBCO_HOME/adapter/adkenan/<version_num>/examples/KenanCustomCallOut/CustomClasses) can be used as a template for compiling the source code. Please modify the environment parameters per your settings and execute the script. This will generate the class files in the same folder.
4.
The compiled class has to be placed in the classpath so that the adapter can pick the same while running. The location of the custom classes is already a part of the CUSTOM_CP_EXT path in the adapter properties file.
Task D Preparing the Custom XSD
The next task is to create the custom XSD (XML Schema Definition), which would be used to generate an XML message for the adapter to process. In this example, there is a schema called CustomRequest.xsd present in $TIBCO_HOME/adapter/adkenan/<version_num>/examples/KenanCustomCallOut. Two mandatory features in the XSD are:
To have the <xs:element name = "CustomRequest"> tag enclosing all other XML tags.
To have an element called CustomFunctionName, which will contain the name of the custom function based on which the custom function factory generates the appropriate message handlers.
Task E Importing the project
Before starting the example, you must import the sample project zip file and save it in a new project.
5.
Start TIBCO Designer.
Click Programs > TIBCO > TIBCO Designer <version_num> > Designer <version_num>.
6.
In the initial dialog box, click New Empty Project and specify a name for the project in the Save Project dialog. Click OK.
7.
Import the project by clicking Project > Import Full Project.
8.
Select the ZIP Archive tab in the Import dialog box.
9.
Browse to select the KenanCustomCallOut_Export.zip file. By default, this is located in $TIBCO_HOME/adapter/adkenan/<version_num>/examples/KenanCustomCallOut/Repository/BusinessWorks folder. Click OK.
10.
In the Import Options dialog box, select Replace existing global variables with those in import and Overwrite on Name Conflict. Click Apply.
11.
Modify the global variables pertaining to the Security Server Settings as well as the RvDaemon parameter as required.
12.
Save the project by selecting Project > Save.
Task F Converting the repository into .dat format
13.
In TIBCO Designer, click Project > Export Full Project.
14.
In the following dialog box, select the Local Repository tab.
15.
Specify a name in the Project Name field and a valid path in the Dir Name. Click Yes.
16.
In the following dialog box titled Create Project, click OK.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved