if (producer instanceof EmbeddedKettleTransformationProducer == false)
{
throw new BundleWriterException
("Invalid object type registered for handler of " + EmbeddedKettleTransformationProducer.class.getSimpleName());
}
EmbeddedKettleTransformationProducer fileProducer = (EmbeddedKettleTransformationProducer) producer;
String absoluteResourceName = writeFile(bundle, dataSourceFileName, queryName, fileProducer);
final AttributeList coreAttrs = new AttributeList();
// the name is static for now
coreAttrs.setAttribute(KettleDataFactoryModule.NAMESPACE, "name", queryName);
coreAttrs.setAttribute(KettleDataFactoryModule.NAMESPACE, "plugin-id", fileProducer.getPluginId());
coreAttrs.setAttribute(KettleDataFactoryModule.NAMESPACE, "stop-on-error",
String.valueOf(fileProducer.isStopOnError()));
xmlWriter.writeTag(KettleDataFactoryModule.NAMESPACE, "query-embedded", coreAttrs, XmlWriter.OPEN);
// Now writes the name of the file that the KTR is stored in.
xmlWriter.writeTag(KettleDataFactoryModule.NAMESPACE, "resource", XmlWriter.OPEN);