public static RowMetaInterface getInputRowMeta( ScriptEngine actualContext, Bindings actualObject, Object[] ArgList, Object FunctionContext ) { if ( ArgList.length == 0 ) { try { Object scmO = actualObject.get( "_step_" ); try { Script scm = (Script) scmO; return scm.getInputRowMeta(); } catch ( Exception e ) { ScriptDummy scm = (ScriptDummy) scmO; return scm.getInputRowMeta(); } } catch ( Exception e ) { throw new RuntimeException( "Unable to get the input row metadata because of an error: " + Const.CR + e.toString() ); } } else { throw new RuntimeException( "The function call getInputRowMeta doesn't require arguments." ); } }
public static void putRow( ScriptEngine actualContext, Bindings actualObject, Object[] ArgList, Object FunctionContext ) { if ( ArgList.length == 1 ) { try { Object[] newRow = (Object[]) ArgList[0]; Object scmO = actualObject.get( "_step_" ); try { Script step = (Script) scmO; step.putRow( step.getOutputRowMeta(), newRow ); } catch ( Exception e ) { ScriptDummy step = (ScriptDummy) scmO; step.putRow( step.getOutputRowMeta(), newRow ); } } catch ( Exception e ) { throw new RuntimeException( "Unable to pass the new row to the next step(s) because of an error: " + Const.CR + e.toString() ); } } else { throw new RuntimeException( "The function call putRow requires 1 argument : the output row data (Object[])" ); } }
ScriptDummy dummyStep = new ScriptDummy( prev, transMeta.getStepFields( stepMeta ) ); jsscope.put( "_step_", dummyStep );
public static RowMetaInterface getOutputRowMeta( ScriptEngine actualContext, Bindings actualObject, Object[] ArgList, Object FunctionContext ) { if ( ArgList.length == 0 ) { try { Object scmO = actualObject.get( "_step_" ); try { Script scm = (Script) scmO; return scm.getOutputRowMeta(); } catch ( Exception e ) { ScriptDummy scm = (ScriptDummy) scmO; return scm.getOutputRowMeta(); } } catch ( Exception e ) { throw new RuntimeException( "Unable to get the output row metadata because of an error: " + Const.CR + e.toString() ); } } else { throw new RuntimeException( "The function call getOutputRowMeta doesn't require arguments." ); } }
if ( rowMeta != null ) { ScriptDummy dummyStep = new ScriptDummy( rowMeta, transMeta.getStepFields( stepname ) ); Scriptable jsvalue = Context.toObject( dummyStep, jsscope ); jsscope.put( "_step_", jsscope, jsvalue );