Updater Exception due to Recursion

Updater Exception due to Recursion

mm1452
Enthusiast Enthusiast
829 Views
4 Replies
Message 1 of 5

Updater Exception due to Recursion

mm1452
Enthusiast
Enthusiast

Hi All,

 

the below exception has been thrown when trying to modify the modified elements.

"Third party updater 'MyUpdater' has experienced a problem and its action had to be canceled."

 

I think that happened because my business logic recursion behaviour

 Any help about how to modify the modified elements?

 

Thanks in advance.

0 Likes
Accepted solutions (1)
830 Views
4 Replies
Replies (4)
Message 2 of 5

jeremytammik
Autodesk
Autodesk
Accepted solution

Afaik, the different updater types have different priorities and are executed in a specific order.

 

Choose the correct updater priority.

 

If that does not help, check out the hints on Dynamic Update of Elements that Mutually Influence each Other in 

 

http://thebuildingcoder.typepad.com/blog/2013/12/devlab-munich.html

 

Here is The Building Coder topic on DMU:

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.31

 

Good luck!

 

Please let us know how you end up solving this.

 

Thank you!

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 5

mm1452
Enthusiast
Enthusiast

Dear Jeremy,

 

Thanks for caring.

 

Regarding the problem, I have tried several approaches like make a condition inside the execute method to end the recursion by checking the equality of the modified elements ids, but the exception still thrown. Also trying to save the elements ids and modify them at the updater destuctor but I have found the updater object still a live! finally I gave up :D.

 

So I have redefined the problem by customizing the event using GetChangeTypeParameter method instead of GetChangeTypeAny which doesn't throw an exception but doesn't satisfy all my need.

 

Thanks,

 

mm

0 Likes
Message 4 of 5

FAIR59
Advisor
Advisor

Inside an Updater you  aren't allowed to use a transaction. When you do, you'll get the message you described.

Message 5 of 5

jeremytammik
Autodesk
Autodesk

Yes, absolutely!

 

The updater already has a transaction open.

 

The whole point of the updater framework is to enable an add-in to include its modifications in the same transaction as the trigger.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes