# Restore reference to other tree nodes on loading the program

**URL:** <https://forum.universal-robots.com/t/restore-reference-to-other-tree-nodes-on-loading-the-program/6126>\
**Category:** URCaps SDK\
**Created:** [January 22, 2020, 9:44am UTC](https://forum.universal-robots.com/t/restore-reference-to-other-tree-nodes-on-loading-the-program/6126 "2020-01-22T09:44:32Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![anon34273707](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@anon34273707](https://forum.universal-robots.com/u/anon34273707)\
**Post date:** [January 24, 2020, 11:34am UTC](https://forum.universal-robots.com/t/restore-reference-to-other-tree-nodes-on-loading-the-program/6126/6 "2020-01-24T11:34:19Z")

</div>

I found another workaround.

First I register all the root contributions in a static contributions keeper, which just has a list of all the current root contributions. In the `updateView` function og the nodes that need references, I can locally check if the references are set up. If they are not set up, I can call the static contribution keeper, and ask it to call the set-up method for all the root contributions that are registered.

Note that the contributions should ideally be deleted when the user deletes them. Although this is not trivial, [this question](https://forum.universal-robots.com/t/programnodes-can-detect-when-removed-or-suppressed/3888/4) notes that you can use `generateScript` to check in the currently active contributions. The method is called when all nodes are green and the user presses either save or play. By having a `ContributionKeeper.getInstance().checkIn(this)` in the root contribution, you can keep an updated list.

---

_[View the full topic](https://forum.universal-robots.com/t/restore-reference-to-other-tree-nodes-on-loading-the-program/6126)._
