0

When I pass params into my Custom Function and I want to get it, I need to do it by that:

 @Override
    protected Object process(Object obj) {

param1 = obj[0];
param2 = obj[1];
}

but when I have 30 params I need to repeat this process almost 30 times, and when something change in my input params I will have to change index too. So my question is, is possible to get params in Custom Fucntion by they names? Like that for example:

param1 = "getAttributeByName('param1Name')";
param2 = "getAttributeByName('param2Name')";

Similar thing is available in Transformer, but is it possible in Function?

Community
  • 1
  • 1
Kacu
  • 438
  • 4
  • 23

1 Answers1

0

No Kacu, It is not possible for function.. But since you have the stream definition, can't you get event schema information from that and get the attribute by index.. ?

Mohanadarshan
  • 830
  • 5
  • 5
  • I do this way right now and I need something else. This is good way if you don't have a lot of params. But if you have for example 1500 params and remove one param from stream, you don't want to serach for specific index, remove it and change indexes for rest params. A better way would be find this param by name and remove it. – Kacu May 12 '15 at 11:34