Using tJava to display status messages and variables
tJava
is a very useful component for logging purposes, because it can be used in its own sub job. This enables tJava
to be used to print job status information at given points in the process. The following recipe demonstrates this.
Getting ready
Open the jo_cook_ch10_0070_loggingWithtJava
job.
How to do it...
The steps for using tJava to display status messages and variables are as follows:
Open
tJava_1
and add the following code:System.out.println("\n\nSearching directory "+context.cookbookData+"chapter10 for files matching wildcard *jo*\n\n");
Open
tJava_2
and add the following code:System.out.println("Processing file: "+((String)globalMap.get("tFileList_1_CURRENT_FILE")));
Open
tJava_3
and add the following code:System.out.println("\n\nCompleted......"+((Integer)globalMap.get("tFileList_1_NB_FILE"))+" files found\n\n");
How it works...
tJava_1
and tJava_3
simply print out process status information (starting process and process end). tJava_2...