Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

UndoEditItems fails with exception 1364 (InvalidLock)

3 REPLIES 3
Reply
Message 1 of 4
ewcv
438 Views, 3 Replies

UndoEditItems fails with exception 1364 (InvalidLock)

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

3 REPLIES 3
Message 2 of 4
Redmond.D
in reply to: ewcv

Here is the order of operations when updating items from files:

  1. Check out the file.
  2. Make all the updates to the file.
  3. Check the file back in.
  4. Call UpdateItemsFromFiles.  I don't think you need to call EditItems.
  5. Check the status array from the ItemsAndFiles return value.
  6. For items that were Updated or Promoted (created) commit those items.

 

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.



Doug Redmond
Software Engineer
Autodesk, Inc.

Message 3 of 4
ewcv
in reply to: Redmond.D

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'.

 

Message 4 of 4
Redmond.D
in reply to: ewcv

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.



Doug Redmond
Software Engineer
Autodesk, Inc.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report