Object a = new String(“a”);
Object b = new String{“b”,“B”};
Object c = new String{“c”,“C”};
Object d = new String(“d”);
Object ObjArray = new Object{a, b, c, d};
I have done this before and is infact this how WM works with its Object data types when you are working in a Java Service (Which is the reason you have to cast IDataCursor.getValue()).
The previous post was if the input parameter had to be type String.
I gave your suggestion a shot. However, I seem to come across the same problem that I had in my orignal scenario when I inspect the pipeline.
That is, if I look at the values of ‘b’ and ‘c’ in your above code in the ObjArray, I see “[Ljava.lang.String;@1c86820” and “[Ljava.lang.String;@2c4842” instead of the values that were assigned to them. Is this as designed?
Hello,
Yes this is fine, when you view arrays in java, they display there Memory address. To see there contents, you will have to loop over the arrays individually. If you make a java service to output the array, then make a flow service to contain this java service and hand map each element to there WM types (String, String List, String List, String). When you look at the pipeline after that operation, you should see all your values. So to recap:
Flow service{
java service - generate the COM array
map - pull out each element to their respective type
}
Good luck.