I'm currently building a DSC which takes in a list (java.util.List) of ints and returns the modified list. In workbench I am mapping the input and output lists to the same variable. Basically the idea behind the DSC is to modify a list and return it. Normally the variable (in LC) should simply hold the new contents of the list. Unfortunately this is not what happens. I ran different tests and basically I can see the contents of my returned list being added to the list that is specified in the output variable. I don't know why the server would do that but that's what I see.
Here's an example:
1. My input list holds 0 items.
2. Invoke the DSC, it adds the number 5 to the list and returns it.
3. My input list now holds 1 item: 5.
4. Invoke the DSC again and this time add the number 10.
5. Inspecting the list though the recording, you will see that it now holds 4 items: 5,10,5,10
The reason behind the result in step 5 is that the list is passed in as a reference and that that same reference is returned.
So basically since LC holds a reference to the list, it is already updated by the time the list is returned from my DSC. And when it is returned the returned list contents gets added to itself.
Here's the method from the DSC:
public java.util.List<Integer> Test1(java.util.List<Integer> lst, int item)
Any help is greatly appreciated!
I forgot to mention, I also tried returning the list into another variable and the problem is always visible; the returned list gets appended to the contents of the list specified in the variable.
Apparently this is how things are built inside LiveCycle. This seems totally wrong but that's how things are. I got this from contacting Adobe support.