Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Codegeneration FolderType
January 13, 2017
9:59, EET
Avatar
kapsl
Member
Members
Forum Posts: 57
Member Since:
December 20, 2016
sp_UserOfflineSmall Offline

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

January 13, 2017
10:38, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

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

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
11 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 683

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

digitechroshni, LouieWreve, Kickbiche, karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1