Hello, I have a question regarding the lifecycle of a node in the server-sdk:
Assuming an object with a HasComponent reference to a variable. The variable is not being referenced elsewhere.
When deleting the underlying object using BaseNodeManager.DeleteNode(...), will the variable still be "alive"?
I checked this by deleting the object and afterwards tried to add a new reference on another object to this abandoned node. I was surprised this to be working.
So, when is a node really considered to be decoupled/disposed from the sdk? What is the lifecycle of a node? This is important to know when making structural changes to the server while it is already up and running...
thanks for helping
Hartmut
Lifecycle of a Node in Server-SDK
Moderator: uasdknet
- Support Team
- Hero Member
- Posts: 3070
- Joined: 18 Mar 2011, 15:09
Re: Lifecycle of a Node in Server-SDK
Hello,
If a complex object or variable is created, the children defined by the TypeDefinition are created automatically. If a node is deleted, these automatically created nodes are deleted, too.
In addition you can set the ParentAsOwner property of the CreateInstanceSettings to 'true'. In this case a "root-node" is also deleted when the parent is deleted.
Please see ParentAsOwner.
If a complex object or variable is created, the children defined by the TypeDefinition are created automatically. If a node is deleted, these automatically created nodes are deleted, too.
In addition you can set the ParentAsOwner property of the CreateInstanceSettings to 'true'. In this case a "root-node" is also deleted when the parent is deleted.
Please see ParentAsOwner.
Best regards
Unified Automation Support Team
Unified Automation Support Team