I use the "Copy to SharePoint" action to copy item attachments to a document library.
When no error occurs a Web service removes all attachments from the item.
Now comes a state machine and users might attach documents to the item again.
So I use the "Copy to SharePoint" action again.
If users do attach new documents while in State machine the "Copy to SharePoint" action does it job without errors.
If users do not attach new documents the "Copy to SharePoint" action throws an error although the item has no documents!
Error message: Cannot open file "Lists/Listname/Documentname".
It seems that the "Copy to SharePoint" action does not update the items Attachment property.
I tested all possible variations of when to attach documents and the overall result is always ok.
The workflow runs through and all attachments are being copied and detached.
But it is annoying to get this error message in case items have been attached initially but not during state machine.
Could anybody tell if this is a flaw in the "Copy to SharePoint" action and if there is anything we can do about it?
Commit pending changes does not help.
I kind of solved the problem as I wrapped the second "Copy to SharePoint" action in a "Run if current items attachments" = Yes.
Now the second "Copy to SharePoint" action only runs if documents have been attached during State machine.
Strange though is that workflow history still reports "The Attachment field on the current item equals 'true'" in both cases (whether or not an item has been attached during state machine)
I hope there is anyone who understands my humbly explanation.
I mark this question as assumed answered.
I would be still interested in a profound explanation of the behavior of "Copy to SharePoint" action and the items attachment property.