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


Chapter 5 Advanced Features : Handling DATE Fields

Handling DATE Fields
You can handle DATE fields in TIBCO ActiveMatrix BusinessWorks. By default, TIBCO ActiveMatrix BusinessWorks accepts data for dateTime fields in the format YYYY-mm-ddThh-mm-ss. This format is not acceptable to the Kenan API-TS which expects the dateTime fields to be in the YYYY-mm-dd hh-mm-ss format. (Please note the space in between).
To use a custom Java code to transform the date fields:
1.
Drag and drop the Java Code activity from the palette panel to the design panel.
2.
3.
Type in in the Field name field. The in parameter means case sensitive.
4.
Select Required in the Occurrence drop-down list.
5.
Select string in the Type drop-down list.
6.
Similarly, add an output parameter with the Field name as out (case sensitive), Type as string, and Occurrence as Required.
7.
Select the Code tab. Select the Invoke Method Body radio button.
8.
int i=0;
do
{
i = in.indexOf("dateTime");
if (i != -1)
{
out = out + in.substring(0,i+20) + " ";
in = in.substring(i+21,in.length());
}
else
{
out = out + in;
}
}while (i != -1);
9.
Click Apply.
10.
Click Compile. You will see a dialog box saying Code compiled successfully.
11.
Attach a trigger from the Render XML task to the Java Code task. Attach a trigger from the Java Code task to the Invoke Request-Response Service task.
12.
Map the XMLSTRING output of the Render XML task to the in input of the Java Code.
13.
Similarly, map the out output of the Java Code to the InXMLMsg input of the Invoke task.
Figure 7 Java Code

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