Vault Customization

Vault Customization

Reply
Contributor
sabuj.saha
Posts: 14
Registered: ‎06-01-2012
Message 1 of 3 (232 Views)

manage state in UpdateFileLifecycleStateEvents_GetRestrictions event handler

232 Views, 2 Replies
01-05-2013 10:40 PM

In my inventor addin I am doing some validation before changing state of a component in vault to Release.

I have event handler UpdateFileLifecycleStateEvents_GetRestrictions where I can do that. However i dont know how do i verify that the state being change to release cause that is the only time I need to validate. Here is some of my code. 

 

public void Activate(ApplicationAddInSite addInSiteObject, bool firstTime)
{
_inventorApp = addInSiteObject.Application;
_fileUIEvents = _inventorApp.FileUIEvents;

DocumentServiceExtensions.UpdateFileLifecycleStateEvents.GetRestrictions += new EventHandler<UpdateFileLifeCycleStateCommandEventArgs>(UpdateFileLifecycleStateEvents_GetRestrictions);
}

 

void UpdateFileLifecycleStateEvents_GetRestrictions(object sender, UpdateFileLifeCycleStateCommandEventArgs e)
        {
            
        }

 

ADN Support Specialist
xiaodong.liang
Posts: 1,306
Registered: ‎06-12-2011
Message 2 of 3 (218 Views)

Re: manage state in UpdateFileLifecycleStateEvents_GetRestrictions event handler

01-13-2013 06:41 PM in reply to: sabuj.saha

Hi,

 

It looks a question of Vault API. I have asked the moderator to move this case to the board 

http://forums.autodesk.com/t5/Autodesk-Vault-Customization/bd-p/301



Xiaodong Liang
Developer Technical Services
Autodesk Developer Network

Employee
Redmond.D
Posts: 814
Registered: ‎12-12-2006
Message 3 of 3 (191 Views)

Re: manage state in UpdateFileLifecycleStateEvents_GetRestrictions event handler

01-15-2013 05:25 AM in reply to: xiaodong.liang

The event args has the information you need but you usually need to make some API calls to gather all the information.  You can find the FROM states by looking up the File object from the FileMasterIds.  You can find more information about the TO state by looking up the LfCycState objects from the ToStateIds.

 

The easiest way to open up a connection to the Vault Server is to cast the sender object to IWebService object.  Use it to create a new WebServiceCredentials, then create a new WebService object.



Doug Redmond
Software Engineer
Autodesk, Inc.
http://justonesandzeros.typepad.com/

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!