Hi,
I am trying to add method implementation logic behind my methods. When using simple types I can successfully add implementation logic, however when using more complex types with compositional aggregation relationships (objects within an object) I am having difficulties.
Example:
- Parent Object
- Parent Property
- Parent Method()
- Child Object
- Child Property
- Child Method()
When I add method implementation to the parent object only, LinkModelToNode(NodeId(ParentInstance), ParentMethodModel, ....) then its method implementation executes successfully. However if I also try to link method implementation to the child instance then the parent implementation logic fails to execute, LinkModelToNode(NodeId(ChildInstance), ChildMethodModel, ....).
What is the correct approach for adding method implementation for objects within objects?
Method Implementation - LinkModelToNode
Moderator: uasdknet
- Support Team
- Hero Member
- Posts: 3068
- Joined: 18 Mar 2011, 15:09
Re: Method Implementation - LinkModelToNode
Hello,
There is an issue with the mapper and methods.
You need to call LinkModelToNode once for each sub-object.
Best regards
Support Team
There is an issue with the mapper and methods.
You need to call LinkModelToNode once for each sub-object.
Code: Select all
m_serverObject.Configuration.ModelHandle = m_rootNodeManager.LinkModelToNode(ObjectIds.ServerConfiguration, m_serverObject.Configuration, null, null, 1000);
m_serverObject.Configuration.ServerConfigurationMethods = this;
m_serverObject.Configuration.ModelHandle = m_rootNodeManager.LinkModelToNode(ObjectIds.ServerConfiguration_TrustList, m_serverObject.Configuration.TrustList, null, null, 1000);
m_serverObject.Configuration.TrustList.FileMethods = m_serverObject.Configuration.TrustList;
Support Team
-
- Jr. Member
- Posts: 1
- Joined: 22 Jan 2019, 08:39
Re: Method Implementation - LinkModelToNode
Hi,
has this problem been fixed in the meantime? I came across the same problem and found this post from 2014. Calling LinkModeltoNode for all child objects can be really annoying if you have lots of nested objects... I understand that this was a bug in 2014, but hasn't it been fixed until now? Or is there some other way how to set up methods for objects including all nested childs.
Thanks
has this problem been fixed in the meantime? I came across the same problem and found this post from 2014. Calling LinkModeltoNode for all child objects can be really annoying if you have lots of nested objects... I understand that this was a bug in 2014, but hasn't it been fixed until now? Or is there some other way how to set up methods for objects including all nested childs.
Thanks