# How to get the type of a UR CAP Node?

**URL:** <https://forum.universal-robots.com/t/how-to-get-the-type-of-a-ur-cap-node/15652>\
**Category:** URCap Development\
**Tags:** welding\
**Created:** [July 28, 2021, 7:00pm UTC](https://forum.universal-robots.com/t/how-to-get-the-type-of-a-ur-cap-node/15652 "2021-07-28T19:00:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eric.feldmann](https://avatars.discourse-cdn.com/v4/letter/e/94ad74/32.png) [@eric.feldmann](https://forum.universal-robots.com/u/eric.feldmann)\
**Post date:** [July 28, 2021, 7:00pm UTC](https://forum.universal-robots.com/t/how-to-get-the-type-of-a-ur-cap-node/15652/1 "2021-07-28T19:00:02Z")

</div>

I have a somewhat specific question here. I currently have 2 CAPs: One is for welding, and one is for controlling an external positioner/axis.

The welding CAP consists of a parent node, with the children being moves allowed while welding. I don’t want to allow any other nodes to be inserted as children. So originally I set the childLockSequence to true, and inserted Welding moves via my screens on the CAP. Works great.

Now I want to ALSO allow the insertion of the external positioner’s moves (a seperate CAP) inside the Welding parent. So now I unlock the childSequence and perform a traversal check in the generateScript to stop the program if I find any nodes that aren’t either my Welding moves, or the Positioner’s moves.

However, I cannot find the right method to return the exact type of the URCAPnode. This has to be possible, because I am able to crash the program by attempting to cast the positioner move to a customAPI of the Welding move. This doesn’t work (obviously) but the stack trace says: cannot cast from com.myCompany.RotaryCAP.RotaryProgramNodeContribution to com.myCompany.WeldingCAP.myCustomAPI

So ultimately my question is: What is the correct method to call on a programNode such that it returns com.myCompany.RotaryCAP.RotaryProgramNodeContribution? Or more generally, returns the exact name of the node’s contribution?
