- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am exploring the possibility of utilizing an IUpdater with a custom defined FailureDefinition to try to prevent elements not on a user's active workset from being deleted. I am being inspired by Jeremy Tammik's post on Lock the Model, e.g. Prevent Deletion.
I know on the surface it would seem that what I am seeking to do is not possible. With the most obvious reason being the fact that with using an IUpdater triggered by Element.GetChangeTypeElementDeletion(), the element is already deleted from the model and as such no information other than the deleted element's ID can be obtained through the IUpdater to allow filtering out elements that should be illegal for deletion to passthrough to the failure message.
However I am hopeful that perhaps there is indeed a way to achieve my goal of preventing deletion of elements not on a user's current active workset. This hope is born from the fact that when a list of deleted element IDs is collected through the IUpdater and added as failing elements to a failure message the end user is presented with a warning that includes workset information. see first image below. Below are also images of the very simple IUpdater and Failure Definition used to generate the user warning in seen in the first image.
My questions are why can I see the workset of the deleted element in the warning, but I can not access it in the IUpdater? Is their a way to actually get the workset of the deleted element? Or maybe a back door way I could use the fact that the warning contains the workset of the element to my advantage to achieve my goal?
Thanks in advance for any advice or insight anyone is willing to provide.
Solved! Go to Solution.