Java service not working as expectd

Hi,

I wrote java service with two inputs (documentList1 and documentList2 with same variable)

Service will find any new values are exist in documentList2 by comparing documentList1.

(Ex: documentList1 {1,2,3} and documentList1 {1,2,3,4,5})

If I run this java service by giving input values then I am getting correct output, no issue with java service.
Result: {4,5}

But when I map documentList1 and documentList2 with source document
OR
when I hard code documentList1 and documentList2 then it is behaving differently, it is just returning all documentList2 values.
Result:{1,2,3,4,5}

Can any one has idea, why this behaviour?
Appreciate your help!

Thanks
Ravi.

(Ex: documentList1 {1,2,3} and documentList2 {1,2,3,4,5})

The issue you see might be due to the “Copying By Reference” you can find this details in 10-3_Service_Development_Help.pdf

What is your inputs and expected output, we can try with a java service and share you one? Instead of DocumentList can StringList be as input?

documentList1 ? - Structure with data
documentList2 ? - Structure with data

Output ? - Sturcutre with data

Thanks Mahesh for your Reply and help.

In my java service I have used different names instead documentList1 & documentList2 . for easy understand I was mention like that.
Anyhow I able to fix this issue.

Thank you
Ravi.

Great that you resolved, can you share us what was wrong and how did you resolve it.