Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dshvedchenko/402d4793fe1d385ec11a59a7f659cacf to your computer and use it in GitHub Desktop.
Save dshvedchenko/402d4793fe1d385ec11a59a7f659cacf to your computer and use it in GitHub Desktop.
function outputResult(outData) {
var row = createRowCopy(rmi.size());
for ( var uCol in outData) {
var valIdx = rmi.indexOfValue(uCol);
if (valIdx >= 0) {
row[valIdx] = outData[uCol];
}
}
  putRow(row);
}
//Script here
var rmi = getOutputRowMeta()
rmi.clear()
var field = new org.pentaho.di.core.row.ValueMeta("FILE_URL", org.pentaho.di.core.row.ValueMetaInterface.TYPE_NUMBER)
rmi.addValueMeta(field)
field = new org.pentaho.di.core.row.ValueMeta("FILE_WILDCARD", org.pentaho.di.core.row.ValueMetaInterface.TYPE_STRING)
rmi.addValueMeta(field)
field = new org.pentaho.di.core.row.ValueMeta("FILEJSON", org.pentaho.di.core.row.ValueMetaInterface.TYPE_STRING)
rmi.addValueMeta(field)
outputResult({
FILE_URL: 123,
FILE_WILDCARD: "privet",
})
outputResult({
FILE_URL: 123,
FILE_WILDCARD: "privet",
FILEJSON: "another string"
})
trans_Status = SKIP_TRANSFORMATION;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment