return true;
}
private boolean executeTransformation( final TransMeta transMeta ) {
boolean success = true;
Trans trans = null;
try {
if ( transMeta != null ) {
try {
trans = new Trans( transMeta );
} catch ( Exception e ) {
throw new KettleComponentException( Messages.getInstance().getErrorString(
"Kettle.ERROR_0010_BAD_TRANSFORMATION_METADATA" ), e ); //$NON-NLS-1$
}
}
if ( trans == null ) {
throw new KettleComponentException( Messages.getInstance().getErrorString(
"Kettle.ERROR_0010_BAD_TRANSFORMATION_METADATA" ) ); //$NON-NLS-1$
}
// Remember where to get our execution logging from
//
logChannelId = trans.getLogChannelId();
// OK, we have the transformation, now run it!
if ( !customizeTrans( trans ) ) {
throw new KettleComponentException( Messages.getInstance().getErrorString(
"Kettle.ERROR_0028_CUSTOMIZATION_FUNCITON_FAILED" ) ); //$NON-NLS-1$
}
debug( Messages.getInstance().getString( "Kettle.DEBUG_PREPARING_TRANSFORMATION" ) ); //$NON-NLS-1$
try {
LogLevel lvl = getLogLevel();
trans.setLogLevel( lvl );
trans.prepareExecution( transMeta.getArguments() );
} catch ( Exception e ) {
throw new KettleComponentException( Messages.getInstance().getErrorString(
"Kettle.ERROR_0011_TRANSFORMATION_PREPARATION_FAILED" ), e ); //$NON-NLS-1$
}
String stepName = null;
String outputName = null;
try {
debug( Messages.getInstance().getString( "Kettle.DEBUG_FINDING_STEP_IMPORTER" ) ); //$NON-NLS-1$
stepName = getMonitorStepName();
outputName = getTransformSuccessOutputName();
if ( outputName != null ) {
registerAsStepListener( stepName, trans );
}
} catch ( Exception e ) {
throw new KettleComponentException( Messages.getInstance().getErrorString(
"Kettle.ERROR_0012_ROW_LISTENER_CREATE_FAILED" ), e ); //$NON-NLS-1$
}
try {
debug( Messages.getInstance().getString( "Kettle.DEBUG_STARTING_TRANSFORMATION" ) ); //$NON-NLS-1$
trans.startThreads();
} catch ( Exception e ) {
throw new KettleComponentException( Messages.getInstance().getErrorString(
"Kettle.ERROR_0013_TRANSFORMATION_START_FAILED" ), e ); //$NON-NLS-1$
}
try {
// It's running in a separate thread to allow monitoring,
// etc.
debug( Messages.getInstance().getString( "Kettle.DEBUG_TRANSFORMATION_RUNNING" ) ); //$NON-NLS-1$
trans.waitUntilFinished();
cleanLogChannel( trans );
trans.cleanup();
} catch ( Exception e ) {
throw new KettleComponentException( Messages.getInstance().getErrorString(
"Kettle.ERROR_0014_ERROR_DURING_EXECUTE" ), e ); //$NON-NLS-1$
}