IsDefined Calls

I was wondering what all can happen for this function to be called?

I have also noticed in a program when I have two of the same nodes newly created and without doing any modifications on either of them, the node at the top of the program gets extra IsDefined calls the every node after it. Is this normal or is there a reason behind it?

From the manual here: https://www.universal-robots.com/media/1819317/urcap_tutorial_swing.pdf

" The isDefined() method is called when values are written to the DataModel to ensure that the program tree reflects the proper state of the program node."

The isDefined() will also be called on the parent for any child nodes that get their datamodels modified. Sometimes you will see odd behavior when inserting multiple of the same node if you aren’t properly setting datamodel values.

Is there a DataModel for the RobotProgram then that is being modified when switching between two nodes? I setup a counter so that when the node was opened it would only display the count without any datamodel changes and still seeing it being called 2 when switching between two nodes and even larger count when clicked on the “RobotProgram” and back to the program nodes.

Ex:
IsDefined: only increments counter by 1 and returns true
OpenView: update view with counter value and reset counter
CloseView: empty

Probably. The robot program node likely follows a similar track, since it is also only turns white when all its children’s “isDefined()” methods return true. Can I ask what you’re trying to accomplish here? The isDefined()'s only job is to turn the Node from yellow to white.

Just looking at ways to reduce lag for larger programs which included looking deeper into the isdefined and finding ways to reduce the number of calls it gets per node.