Hi,
I'm working with Vault 2012,
in order to update a property of a drawing document linked to an item (secondary link) and thereafter update a property of this item,
editItem = m_ServiceManager.ItemService.EditItem(editItem.RevId);
is called, the file is checked out, the property is updated and the file is checked in and the property of the item is changed by UpdateItemProperties().
To test the failure handling, the document is checked out by another user, so no update is done and only
m_ServiceManager.ItemService.UndoEditItems(new long[] { editItem.RevId });
is called, but the result is an exception:
System.Web.Services.Protocols.SoapException: 1364 bei Connectivity.Web.Services.ItemService.UndoEditItems(Int64[] itemIds)
This behavior is reproducible, but I don't know why.
log file is attached
I have 2 more questions:
Do I have to call EditItem before checking out the document?
Do I have to call UpdateItemsFromFiles after the update of the property of the document or after the update of the item?
Erika
Here is the order of operations when updating items from files:
When editing an Item, all the edits and the commit must be done in the same user session. If user 1 edits the item and user 2 tries to commit, you get an error. I'm thinking that this is the cause of the error 1364 you are seeing.
Also, I'm not sure if secondary links have an impact when updating items. It may only be the primary file that matters.
So, when UpdateItemsFromFiles works only for primary files, what is to do when the item has secondary (and tertiary) links to show the new versions of the files?
In my workflow the UPD can be set to one file or moved from associated file1 to associated file2, so for file1 the UPD must be empty.
In Vault Explorer, if I right-click an item and say "Update...", which functions are called?
it must be doing a lot more than just calling 'UpdateItemsFromFiles'.
Back to your first post. UndoEditItems is expecting an Item.Id value and you are passing inn Item.RevId. So that's probably the cause of the error. I didn't notice that the first time around.
The workflow you describe in your second post looks OK.
"Assign Item" and "Update Item" are pretty complex operations. The calls being made are dependant on the data and the user actions at each step of the wizard. If you want to see what is going on in your particular case, I suggest running Fiddler, which will show you every API call.