# Have a program node with or without children

**URL:** <https://forum.universal-robots.com/t/have-a-program-node-with-or-without-children/3699>\
**Category:** Product Wishlist\
**Created:** [February 20, 2019, 4:16pm UTC](https://forum.universal-robots.com/t/have-a-program-node-with-or-without-children/3699 "2019-02-20T16:16:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon27046260](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@anon27046260](https://forum.universal-robots.com/u/anon27046260)\
**Post date:** [February 20, 2019, 4:16pm UTC](https://forum.universal-robots.com/t/have-a-program-node-with-or-without-children/3699/1 "2019-02-20T16:16:21Z")

</div>

Is it possible to have a program node that can you only can add children (meaning with the programAPI) but that is also valid if you don’t have any children?

On the tests I made, the only way to add a child was to change in the service the boolean configuration.setChildrenAllowed(true), but this enables the \< empty \> display in the child node and it seems that only way to have the node defined is to put something to replace the empty node.

I also tried to do a root.setChildSequenceLocked(true), but the node is still not defined if it’s empty.

---

<div class="post-metadata">

**Author:** ![thph](https://avatars.discourse-cdn.com/v4/letter/t/b77776/32.png) [@thph](https://forum.universal-robots.com/u/thph)\
**Post date:** [February 22, 2019, 4:06pm UTC](https://forum.universal-robots.com/t/have-a-program-node-with-or-without-children/3699/2 "2019-02-22T16:06:04Z")

</div>

It seems that your parent node would have to contain a defined child for it to be valid 🙂

---

<div class="post-metadata">

**Author:** ![anon27046260](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@anon27046260](https://forum.universal-robots.com/u/anon27046260)\
**Post date:** [February 25, 2019, 7:51am UTC](https://forum.universal-robots.com/t/have-a-program-node-with-or-without-children/3699/3 "2019-02-25T07:51:52Z")

</div>

Thanks for the reply. I will then move my topic to feature request as currently it’s not possible.

My suggestion would be to be able to modify the setChildrenAllowed from the programContribution (this sould have to make this a contribution property instead of a property on the service level).

Another suggestion would be to create a new type of property that can or can’t have children but these children can only be added by the programmer and thus we would never see on Polyscope the field.

Example : an user can choose if he wants a timeout or not on a selected command. If he wants it, then I add a “if timeout” child. If not, I want to be leave this command childless.
