Pentaho Kettle Component
This component shows a good example how to call a Transformation or a Job from another Java program.
It can be found in the package org.pentaho.plugin.kettle in the Pentaho-BI-Server project.
Get the source code here.
Program your own Kettle transformation
Recommendation for upward compatibility: If you want to create your own Transformation dynamically (e.g. from meta-data), use the method of generating a XML-file (KTR) instead of using the API. The XML-files are compatibility from the first Version of Kettle until now. This is the same for Jobs.