API - Change Order Lifecycle Change Pre Event Looping

API - Change Order Lifecycle Change Pre Event Looping

Anonymous
Not applicable
676 Views
1 Reply
Message 1 of 2

API - Change Order Lifecycle Change Pre Event Looping

Anonymous
Not applicable

I have a Vault 2012 Pro addin that modifies a word document attached to a change order as it progresses through different lifecycle states.  I want to automatically update the word document to add the date on which the change order moves from an Approved state to closed (Set Effectivity) state.  I added an event handler to my addin to hook into the UpdateChangeOrderLifecycleStateEvents.Pre event, and inside the event handler I check the activity id to capture the correct state change.

 

That all works fine.   My problem comes in that the Pre event appears to be looping.  The Pre event gets called 10-20 times in a row before it completes the state change.  This results in many identical versions of my word document in the Vault.  

 

I'm confused as to why the event is looping; I'm not actually editing the change order, just a file attached to it.  Is there a way to prevent the event from firing multiple times?

0 Likes
677 Views
1 Reply
Reply (1)
Message 2 of 2

Redmond.D
Autodesk
Autodesk

I suggest having a look at video 5 in my webinar series on the Vault API.  Around 0:31:35 I go in to infinate loops and how to avoid them.

 



Doug Redmond
Software Engineer
Autodesk, Inc.

0 Likes