Expand my Community achievements bar.

Over writing List Variable (for attachments)

Avatar

Level 10

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.

Thanks,

Nith

3 Replies

Avatar

Level 10

I resolved this issue by using the empty-list() method

Thanks,

Nith

Avatar

Level 2

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.

/process_data/attachList1[1]

When you select the variable or set the expression to /process_data/attachList1, you are appending to the list, as you have already discovered.

Avatar

Level 10

Thanks Julie,

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,

Nith