Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Talend Open Studio Cookbook

You're reading from  Talend Open Studio Cookbook

Product type Book
Published in Oct 2013
Publisher Packt
ISBN-13 9781782167266
Pages 270 pages
Edition 1st Edition
Languages
Author (1):
Rick Barton Rick Barton
Profile icon Rick Barton

Table of Contents (21) Chapters

Talend Open Studio Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Introduction and General Principles 2. Metadata and Schemas 3. Validating Data 4. Mapping Data 5. Using Java in Talend 6. Managing Context Variables 7. Working with Databases 8. Managing Files 9. Working with XML, Queues, and Web Services 10. Debugging, Logging, and Testing 11. Deploying and Scheduling Talend Code 12. Common Mistakes and Other Useful Hints and Tips Common Type Conversions
Management of Contexts Index

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 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...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}