I am facing issue with overwritng the values of a list variable.
The scenario is:
A Task is assigned to a user with one attachment (which is available in a variable named attachList1)
On Notes & Attachments panel, the option 'Copy all attachments to the list variable' (attachList1) is selected.
After completing the task (without adding any attachments), the list variable contains two attachments (duplicate documents).
I tried to save the output attachments to another variable named attachList2 and tried to overwrite the first variable.
But still i get attachment appended to the list1; I want to overwrite all the previous attachments..
Any hint is appreciated.
I resolved this issue by using the empty-list() method
You could also use an XPath expression when setting the Output list. The following expression writes over the full list starting at the first element.
When you select the variable or set the expression to /process_data/attachList1, you are appending to the list, as you have already discovered.
This is somewhat different from regular java assignment as if we do it in this way in java, the first element in the list will hold all the list values (i.e list of list values).
Anyways this is also helpful information.
I used empty-list() function before assigning so that the list is now cleared before appending the new values.
Thanks & Regards,