cancel
Showing results for 
Search instead for 
Did you mean: 

Graphical mapping or UDF

Former Member
0 Kudos

Hi,

In my mapping i have a requirement where the input can be any of three values or not existing. (lets just call them V0, V1, V2 and V3, where V0 is the not existing tag)

If the input is V0, or V1 or V2 i need output an Empty Constant, If the input is V3 i need to pass the value.

I've worked this out with a graphical mapping, but it involves a lot of boxes. It works though.

I'm still wondering if i can do it with a UDF though. Only problem is that my JAVA knowledge is not nearly as good as it should be, so maybe one of you out there can give me some ideas/code.

The thing that give the most headache is the fact that the tag might not exist at all in the source message. How do I deal with that in JAVA code?

Any ideas are welcome.

Kind regards

Robert

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Problem is solved

Former Member
0 Kudos

Hi Robert,

below is the Jave code, below code is w.r.t exection type as CONTEXT/QUEUE

public void calculate(String[] var1, String[] var2, String[] var3, String[] var4, ResultList result, Container container) throws StreamTransformationException{

if(var1.length != 0 || var2.length != 0 || var3.length != 0)

result.addvalue(" ");

else if(var4.length != 0)

result.addValue(<passthe value>);

}