9:59, EET
December 20, 2016
Hi together,
currently I’m having following problem: I model a new type in UaModeler and in the new type is a FolderType which contains e.g. methods. If I now do codegeneration for java, I get a function, which gives me this folder type, but nothing for the subitems. So basically I can’t access the methods in the folder. Is this a bug in the codegenerator?
lg Manu
10:38, EET
April 3, 2012
Hi,
This is not possible at the moment at least. Assuming you meant that these methods would be part of the “new type”, and not of the FolderType instances, I’m not even sure this is allowed by the specification, as version 1.03 Part 4 Table 64 on Call Service Parameters do state for the objectId parameter:
The NodeId shall be that of the Object or ObjectType on which
the Method is invoked.
In case of an ObjectType the ObjectType or a supertype of the
ObjectType shall be the source of a HasComponent Reference
(or subtype of HasComponent Reference) to the Method
specified in methodId.
In case of an Object the Object or the ObjectType of the Object
or a supertype of that ObjectType shall be the source of a
HasComponent Reference (or subtype of HasComponent
Reference) to the Method specified in methodId.
See Part 3 for a description of Objects and their Methods.
I’m my opinion, semantically if there would be methods under the FolderType instance, then those methods are for that instance, not for the “new type”.
Anyway, the codegen creates method implentations for direct HasComponent references and assumes the other methods are part of the instances, which would mean their type/code would contain those method implementations. You could create a subtype of FolderType and the methods to it, but it does mean that those methods should work on instances of that type without the context of the instance being part of a larger type.
This is similar to e.g. a Java type A having field of type B. If B has a method B.example(), then calling this from A would be A.getB().example(), but the instance of B returned by A.getB() would have no knowledge of it being part of A.
– Bjarne
Most Users Ever Online: 1919
Currently Online:
20 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: 730
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1529
Posts: 6471
Newest Members:
HypromeImpupe, toneylapham544, rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466, zkxwilliemae, gabriellabachus, DeakinModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0
Administrators: admin: 1