1

I try to use JavaScript processor steps in StreamSets.

I defined some environment values and can invoke from expression.

${type}='month';

In JavaScript, how to use those environment values?

Can you write a js example for get the value of ${type} in JavaScript in StreamSets?

user504909
  • 9,119
  • 12
  • 60
  • 109

1 Answers1

1

You reference the variable in the same way in JavaScript - EL expression evaluation is performed on the script before it is run. Note that you will need quotes for strings - for example:

var myType = '${type}';

This also works with the Jython evaluator, but it does NOT work from Groovy due to a clash with the Groovy ${} syntax.

metadaddy
  • 4,234
  • 1
  • 22
  • 46