Ask Your Question
0

How can we reuse a javascript function in multiple stages?

asked 2019-10-04 07:56:04 -0600

Kumar gravatar image

I have functionality which I want to call from multiple javascript elevator stages. So where should i place that functionality code in streamsets so that I can call from multiple stages.

Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-10-04 09:35:43 -0600

iamontheinet gravatar image

Hi!

Create a module, make it available in the path, and import ("require") it in the processors. Just like you would any other external library. Might also want to refer to this -- https://streamsets.com/blog/calling-e...

var myModule = require('myModule');

var myModuleInstance = new myModule();
myModuleInstance.hello(); 
myModuleInstance.streamsets();

Cheers, Dash

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-10-04 07:56:04 -0600

Seen: 117 times

Last updated: Oct 04