# Node Destruction Handler

**URL:** <https://forum.universal-robots.com/t/node-destruction-handler/1403>\
**Category:** Product Wishlist\
**Created:** [December 7, 2017, 3:21pm UTC](https://forum.universal-robots.com/t/node-destruction-handler/1403 "2017-12-07T15:21:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![samuel.paxton](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@samuel.paxton](https://forum.universal-robots.com/u/samuel.paxton)\
**Post date:** [December 7, 2017, 3:21pm UTC](https://forum.universal-robots.com/t/node-destruction-handler/1403/1 "2017-12-07T15:21:17Z")

</div>

As a URCap Developer, I would like the the ability to implement some kind of destruction instructions upon program node deletion so that my URCap will behave differently based on the presence of a program node in the current robot program.

I believe this would add some beneficial functionality. For example, if a Program Node is present, more initialization script would be added via generateScript() in the Installation Node Contribution, but if a Program Node is never added, this init script will not be included.

Currently, a Program Node Service object has a `createNode()` method. Adding a `destroyNode()` method to handle node deletion would be perfect. I realize that since Java doesn’t require destructors, this may be much easier said than done.

---

<div class="post-metadata">

**Author:** ![anon61353889](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@anon61353889](https://forum.universal-robots.com/u/anon61353889)\
**Post date:** [November 21, 2022, 8:47am UTC](https://forum.universal-robots.com/t/node-destruction-handler/1403/2 "2022-11-21T08:47:59Z")

</div>

I am looking for exactly this functionality right now, but I don’t think it has been implemented yet? I hope it gets developed in the future.
