Pushing PDI beyond its built-in steps: writing custom logic with JavaScript and Java steps, understanding how to create custom steps and job entries, leveraging community plugins and the marketplace, and packaging transformations into reusable assets for many projects.

Even though PDI has hundreds of built-in steps, sometimes you need logic that isn't available. Episode 16 opens the way out: extensibility. You'll learn three levels of extension — from the simplest (JavaScript in a step) to the deepest (Java plugins and custom steps).
The goal isn't to make you a plugin developer right away, but to understand the capability map: when it's enough to use a built-in step, when to write JavaScript, and when you truly need a Java or community plugin.
The fastest way to add custom logic is the scripting steps available in PDI:
Example: calculating a discount category based on amount with JavaScript:
var jumlah = row.jumlah;
var kategori = jumlah >= 1000000 ? "VIP" : jumlah >= 100000 ? "REGULER" : "BASIC";
row.kategori = kategori;Note that the code above uses the common PDI per-row scripting style: reading fields from the row variable, then setting new fields. Variables like row are context provided by the step.
The JavaScript step provides several helper objects rarely explained in menus: row to read the row's fields, getVariable() to read job/transformation variables, and the putRow() function to send a row out. For those just starting, simply get to know two things: reading fields via row.namafield, and setting new fields with row.fieldBaru = nilai — the rest will follow when the need arises. Official documentation and community examples use the same patterns, so getting used to these conventions makes it easier to read other people's examples.
Info
The JavaScript step should only be used for light logic and should be avoided for large data manipulation — every row is executed by an interpreter far slower than native steps. For large volumes, prefer doing transformations in the database or with native transformations.
A question that often comes up: when is JavaScript enough, and when do you need Java?
| Need | Choice |
|---|---|
| Light calculations, single-row transformations | JavaScript / User Defined Java Expression |
| Complex row-by-row operations | JavaScript with modular functions |
| Processing large volumes at native speed | Built-in steps or Java plugins |
| Integrating external libraries (for example encryption) | Java plugins using jar libraries |
| Doing something that doesn't exist in PDI at all | Custom step / Java plugin |
The golden rule: use the lightest solution that meets the need. JavaScript for prototypes and small business logic; Java only when performance or third-party libraries are truly required.
Behind the scenes, every PDI step is a Java plugin. A custom step is built with:
When a plugin is placed in the plugins/ folder and PDI is restarted, the new step appears in the palette like a built-in step. Although building a plugin from scratch needs deep Java and PDI API knowledge, the payoff is big: steps very specific to your business can be reused across many transformations.
For those just starting, it's recommended to use the plugin SDK provided by the community, or to imitate existing open-source plugins as a template.
Before building a full plugin, there's a smaller component that's often enough: the User Defined Java Class (UDJC) step lets you write short Java directly inside a transformation without building a separate plugin — suitable for logic needing native performance but used in only one place. It's a great bridge to feel the PDI API before committing to building a full plugin.
Before writing your own plugin, check what already exists. The Pentaho Marketplace provides plugins installable directly from PDI, for example:
The Marketplace installation flow: open the menu Tools > Marketplace, search for the plugin, click install, then restart Spoon. Make sure the Java runtime supports the plugin with java -version before choosing a version. Many other plugins are also available in community repositories like GitHub — check version compatibility with your PDI.
Danger
Be careful with third-party plugins: check their reputation and source code, especially if the plugin handles sensitive data. A bad plugin could leak data or hurt PDI performance. For sensitive data, review the code or use official plugins.
You don't always need to write a plugin for reusability. A well-designed transformation can become a "component" called many times:
A transformation like normalisasi_nama.ktr that accepts any field via parameters and returns a clean version is an example of a component reusable anywhere. This pattern is far cheaper than a Java plugin and covers most needs.
Success
A sensible order: use built-in steps, then JavaScript, then community plugins, and only last write your own Java plugin. Each level raises the build and maintenance cost — don't build a rocket when a bicycle is enough.
In episode 16 you understood PDI extensibility: writing custom logic with JavaScript and Java expressions, getting to know the structure of Java-based custom steps and job entries, leveraging community plugins and the marketplace, and packaging transformations into reusable components.
The key takeaways:
In episode 17, we open the big data horizon: big data integration — connecting Pentaho with Hadoop, Spark, and cloud data lakes, understanding the Parquet, Avro, and ORC formats, near real-time streaming ingestion patterns, and data lakehouse support.