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
Selecting optional components after instance creation & adding placeholder components
June 13, 2018
16:58, EEST
Avatar
ashwin.fernandes
Member
Members
Forum Posts: 7
Member Since:
May 24, 2018
sp_UserOfflineSmall Offline

Hi,

Is there a possibility to select the optional components after the typenode instance has been created? Something like “Select optional components” functionality provided by UaModeler. If yes, could you provide me with an example implementation.
I require this because in my implementation, the optional component should be created on a need basis.
How are placeholder(Mandatory or Optional) components added using the SDK. Could you please provide me with an example.

Thanks in advance,
Ashwin

June 13, 2018
17:42, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

At the moment there is no “automatic” way to do that _after_ the instace is created (i.e. after call to NodeManagerUaNode.createInstance or createNodeBuilder returns). However if you do add correct node manually to the instance node in question, it should work as-if it were configured to be instantiated _before_ those calls (for that see MyNodeManager.createAlarmNode in the SampleConsoleServer example). (There are some exceptions, e.g. if the InstanceDeclaration node did override something from the TypeDefinition or if there is special logic added to the afterCreate method of the Type in question)

As far as I’m aware, placeholder nodes are not that much used. 3.x codegen does create a List getter for the Types that have placeholders, which does return all subnodes of the node that have same TypeDefinition and ReferenceType that the placeholder node had. However there is no “special” support for them otherwise, but the Mandatory/OptionalPlaceholders only define that the node will have 0 or more (or at least one if mandatory) subnodes that have the same TypeDefinition and are added with same Reference than the placeholder node had. Therefore you can create instances of them with NodeManagerUaNode.createInstance and add them to the node with .addReference (of the manager or UaNode).

P.S. these apply to SDK 3.x; The Server Tutorial covers some of the above (but I’m aware that it should be better). Also maybe we can give better support for this in a future version.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
15 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: 681

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com

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