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:

  1. Open tJava_1 and add the following code:
    System.out.println("\n\nSearching directory "+context.cookbookData+"chapter10 for files matching wildcard *jo*\n\n");
  2. Open tJava_2 and add the following code:
    System.out.println("Processing file: "+((String)globalMap.get("tFileList_1_CURRENT_FILE")));
  3. Open tJava_3 and add the ...

Get Talend Open Studio Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.