Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Pentaho Data Integration 8 CE

You're reading from   Learning Pentaho Data Integration 8 CE An end-to-end guide to exploring, transforming, and integrating your data across multiple sources

Arrow left icon
Product type Paperback
Published in Dec 2017
Publisher Packt
ISBN-13 9781788292436
Length 500 pages
Edition 3rd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
María Carina Roldán María Carina Roldán
Author Profile Icon María Carina Roldán
María Carina Roldán
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Getting Started with Pentaho Data Integration 2. Getting Started with Transformations FREE CHAPTER 3. Creating Basic Task Flows 4. Reading and Writing Files 5. Manipulating PDI Data and Metadata 6. Controlling the Flow of Data 7. Cleansing, Validating, and Fixing Data 8. Manipulating Data by Coding 9. Transforming the Dataset 10. Performing Basic Operations with Databases 11. Loading Data Marts with PDI 12. Creating Portable and Reusable Transformations 13. Implementing Metadata Injection 14. Creating Advanced Jobs 15. Launching Transformations and Jobs from the Command Line 16. Best Practices for Designing and Deploying a PDI Project

Getting the most out of the Java Class step


In the previous sections, you learned how to use the Java Class step to accomplish basic tasks. The step has a few more characteristics that allow you to create a rich code. The following subsections summarize some of them.

Receiving parameters

To write a more flexible code, you can add parameters. You can do it by configuring the Parameters tab in the lower grid of the Java Class configuration window. For each new parameter, you have to provide a name under the Tag column and a value under the Value column as follows:

Adding parameters

Note

Note that the value for a Java Class parameter can be a fixed value as well as a PDI variable.

In your code, you read a parameter using the getParameter() function, as follows:

 String code = getParameter("CODE");

Note that the parameters don't have a data type and they are read as string values. In case you need to use them in a different format, you should cast the values to the proper data type, as shown in the...

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 €18.99/month. Cancel anytime