16:43, EEST
September 21, 2018
Hi
When creating a node of Type FileTransferStateMachineType (see OPC UA Part 5: Information model) the method getCurrentStateNode() returns a FiniteStateVariableTypeNode, but
getCurrentStateNode().getReference(ReferenceTypeIdentifiers.HasTypeDefinition, false).getTargetNode() returns “NodeId=i=2755, NodeClass=VariableType, BrowseName=StateVariableType, IsAbstract=false, DataType=i=21, ValueRank=-1, ArrayDimensions=null, Value=(null)” where i=2755 is StateVariableType.
Is this a bug or a feature? đŸ˜‰
Is there a workaround for this problem?
11:35, EEST
April 3, 2012
Hi,
I would label it as an interesting bug… hmmm..
A workaround could be to delete that HasTypeDefinition reference and add the correct one manually (since the UaNode itself was of the proper type, just the reference is wrong, i.e. the java type doesn’t define the HasTypeDefinition, skipping some details of why). But other than that it needs fixing in the SDK.
Basically the “more subtype” one should override the Reference (this logic is somewhat complicated i.e. we do the createInstances node-based not java-based as it wont work like that since instancedeclarations are allowed to override stuff), but maybe that doesn’t happen properly (though we did get that one for the node’s type… which is a bit odd). Also we can reproduce this here.
12:02, EEST
September 21, 2018
11:34, EEST
April 3, 2012
So, seems some of the very old internal logic relies on HashSet iteration order, which is bad (thus this can happen randomly and also might depend on java version, as the iteration order is java internal implementation). Basically the HasTypeDefinitions were added in the wrong order so the super-type-ones did override the correct one. We’ll try to fix this in the next release.
Also for the workaround, there is no need to delete the reference, just add the new one and it will replace the wrong one.
P.S.
Probably the logic could use some more updates as we did pick up the correct UaNode type. But in general the HasTypeDefinition cannot be java-class based, as the generated classes can also represent subtypes, if those models are not generated, i.e. for a given TypeDefinition node the “most-subtype-generated-one” will be picked for the UaNode implementation.
Most Users Ever Online: 1919
Currently Online:
18 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 728
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
ellis87832073466, zkxwilliemae, gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala, efrennowell431, wilfredostuart, caitlynfajardo, jeromechubb7Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1