# Can I acces to the ProgramNodeContribution of a FolderNode?

**URL:** <https://forum.universal-robots.com/t/can-i-acces-to-the-programnodecontribution-of-a-foldernode/16624>\
**Category:** URCaps SDK\
**Created:** [September 22, 2021, 12:34pm UTC](https://forum.universal-robots.com/t/can-i-acces-to-the-programnodecontribution-of-a-foldernode/16624 "2021-09-22T12:34:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rforner](https://avatars.discourse-cdn.com/v4/letter/r/b782af/32.png) [@rforner](https://forum.universal-robots.com/u/rforner)\
**Post date:** [September 22, 2021, 12:34pm UTC](https://forum.universal-robots.com/t/can-i-acces-to-the-programnodecontribution-of-a-foldernode/16624/1 "2021-09-22T12:34:17Z")

</div>

Hello, I’m working in a URCap that has a main node with 2 children, both are FolderNode.

```auto
	// Nodes
	FolderNode folder1;
	FolderNode folder2;
		
	// Constructor
	public ToolFunctionsProgramNodeContribution(final ProgramAPIProvider apiProvider, ToolFunctionsProgramNodeView view, final DataModel model, CreationContext context) {
		this.programAPI = apiProvider.getProgramAPI();
		this.model = model;
		this.view = view;
		this.undoRedoManager = apiProvider.getProgramAPI().getUndoRedoManager();
		
		if (context.getNodeCreationType() == CreationContext.NodeCreationType.NEW) {
			initialize();
		}
	}
	
	/**
	 * Initialize program node contribution
	 */
	private void initialize() {
		try {
			ProgramNodeFactory nf = programModel.getProgramNodeFactory();
			TreeNode root = programModel.getRootTreeNode(this);
			root.setChildSequenceLocked(true);
			
			folder1 = nf.createFolderNode();
			folder1.setName("Name1");
			folder2 = nf.createFolderNode();
			folder2.setName("Name2");
			root.addChild(folder1);
			root.addChild(folder2);

		} catch (Exception e) {
			throw new IllegalStateException("Could not add nodes to program tree --> " + e.getMessage(), e);
		}
	}

```

And I want main node isDefined() to be ‘true’ if both children have them function isDefined() equal to true. FolderNode isDefined() is true when all his children are ‘true’ too.

So, how can I acces to isDefined() function of FolderNode?

---

<div class="post-metadata">

**Author:** ![rforner](https://avatars.discourse-cdn.com/v4/letter/r/b782af/32.png) [@rforner](https://forum.universal-robots.com/u/rforner)\
**Post date:** [September 27, 2021, 5:54am UTC](https://forum.universal-robots.com/t/can-i-acces-to-the-programnodecontribution-of-a-foldernode/16624/2 "2021-09-27T05:54:30Z")

</div>

Well, it’s already solved, it isn’t necessary to access the isDefined() function of the child nodes because it seems to be already implemented. A node is defined when his isDefined() function and that of his children are true.
