Page 1 of 1

Missing method arguments on type instance

Posted: 19 Aug 2017, 23:44
by martenbyebye
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?

Re: Missing method arguments on type instance

Posted: 08 Sep 2017, 09:44
by Support Team
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:

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;

Re: Missing method arguments on type instance

Posted: 12 Sep 2017, 16:47
by martenbyebye
Everything was created in code. The provided code works perfectly. Thanks!