Hi,
I define a type with a folder that has a method. This method has InputArguments and OutputArguments. The UA-Expert uses them when I press Call Method. All is good here.
But when I create an instance of that type, the UA Expert cannot see the arguments. (I can browse to the method on the instance). A client can still call the method successfully if it somehow knows the input arguments, but the UI/browsing has a problem. The userData is properly set on the instance method node.
Here is what I am doing:
- create type with folder with method
- create instance of type
- call nodeManager.SetChildUserData on instance method node
Does anyone know what I am missing?
Missing method arguments on type instance
Moderator: uasdknet
-
- Hero Member
- Posts: 21
- Joined: 03 Mar 2017, 16:08
- Support Team
- Hero Member
- Posts: 3064
- Joined: 18 Mar 2011, 15:09
Re: Missing method arguments on type instance
Hello,
If the arguments nodes are having a reference to ModellingRule Mandatory, the nodes are created when calling CreateObject or CreateMethod.
If the ObjectType is created with UaModeler, the ModellingRule is always added to the arguments nodes. If the ObjectType is created in code with CreateObjectType and CreateMethod, the arguments nodes do not get a ModellingRule. The next version of the .NET SDK will fix this issue.
As a workaround you can set the ModellingRule to the arguments nodes explicitly:
If the arguments nodes are having a reference to ModellingRule Mandatory, the nodes are created when calling CreateObject or CreateMethod.
If the ObjectType is created with UaModeler, the ModellingRule is always added to the arguments nodes. If the ObjectType is created in code with CreateObjectType and CreateMethod, the arguments nodes do not get a ModellingRule. The next version of the .NET SDK will fix this issue.
As a workaround you can set the ModellingRule to the arguments nodes explicitly:
Code: Select all
var method = CreateMethod(Server.DefaultRequestContext, settings);
VariableNode property = FindInMemoryNode(method.NodeId, ReferenceTypeIds.HasProperty, false, "InputArguments") as VariableNode;
property.ModellingRuleId = ObjectIds.ModellingRule_Mandatory;
Best regards
Unified Automation Support Team
Unified Automation Support Team
-
- Hero Member
- Posts: 21
- Joined: 03 Mar 2017, 16:08
Re: Missing method arguments on type instance
Everything was created in code. The provided code works perfectly. Thanks!