Hello.
I need to update the node tree to reflect changes in our model. I am trying to update the ParentNodeId of an existing inmemory node but no change in the tree...
my code is :
node = _nodeManager.FindInMemoryNode(settings.RequestedNodeId) as ObjectNode;
node.ParentNodeId = NewParentNodeId;
Does anybody know if this tree update is possible, and how ?
Thanks
Stephen
Update an InMemory node to change his ParentNodeId
Moderator: uasdknet
-
- Full Member
- Posts: 9
- Joined: 24 Jan 2022, 17:13
- Support Team
- Hero Member
- Posts: 3072
- Joined: 18 Mar 2011, 15:09
Re: Update an InMemory node to change his ParentNodeId
Hello Stephen,
Just changing the ParentNodeId of the node instance will not have an effect once the node has been created. You need to delete the referene from the old parent to the node and create a new reference from the new parent node.
https://documentation.unified-automation.com/uasdknet/3.1.1/html/classUnifiedAutomation_1_1UaServer_1_1BaseNodeManager.html#a5bf560ed248fe09bfd0ed686a3a7361e
https://documentation.unified-automation.com/uasdknet/3.1.1/html/classUnifiedAutomation_1_1UaServer_1_1BaseNodeManager.html#ada052041be4314b7465d359041457298
Just changing the ParentNodeId of the node instance will not have an effect once the node has been created. You need to delete the referene from the old parent to the node and create a new reference from the new parent node.
https://documentation.unified-automation.com/uasdknet/3.1.1/html/classUnifiedAutomation_1_1UaServer_1_1BaseNodeManager.html#a5bf560ed248fe09bfd0ed686a3a7361e
https://documentation.unified-automation.com/uasdknet/3.1.1/html/classUnifiedAutomation_1_1UaServer_1_1BaseNodeManager.html#ada052041be4314b7465d359041457298
Best regards
Unified Automation Support Team
Unified Automation Support Team