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
NodeManagerUaNode.deleteNode()
June 16, 2018
18:57, EEST
Avatar
hbrackel
Member
Members
Forum Posts: 144
Member Since:
February 21, 2014
sp_UserOfflineSmall Offline

Hi,

I often need to delete a complete hierarchy of dynamically created nodes. The NodeManagerUaNode.deleteNode(…) would in principle do a perfect job, just it only considers “HasChild” relationships, which leaves “Organized” nodes untouched. The semantics of Organizes is similar to HasChild (IMO – for this purpose). Would you think that it might make sense to add “Organizes” relationships to be considered by NodeManagerUaNode.deleteNode()?

Thanks to using Kotlin, I was able to extend the NodeManagerUaNode’s with this capability; but it would certainly be nice to have it natively available in NodeManager.

Thanks,
Hans-Uwe

June 18, 2018
10:35, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1026
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

We could maybe consider an overload for taking ReferenceTypeIds.

In general using other than HasChild without knowing the context could end up deleting more that was intended. The spec for Organizes:

“The semantic of this ReferenceType is to organise Nodes in the AddressSpace. It can be used
to span multiple hierarchies independent of any hierarchy created with the non -looping
Aggregates References.
The SourceNode of References of this type shall be an Object or a View. If it is an Object then
it should be an Object of the ObjectType FolderType or one of its subtypes”

But the spec for HasChild instead is:

“The semantic i s to indicate that References of this type span a non -looping hierarchy.
Starting from Node “A” and only following References of the subtypes of the HasChild
ReferenceType it shall never be possible to return to “A”. But it is allowed that following the
References there may be more than one path leading to another Node “B”.”

So e.g. for an Instance that would e.g. refer to type nodes with Organizes (e.g. https://forum.prosysopc.com/forum/opc-ua-java-sdk/some-references-go-missing-while-loading-the-nodeset-xml), following and deleting Organizes targets would end up deleting those types also.

June 20, 2018
20:45, EEST
Avatar
hbrackel
Member
Members
Forum Posts: 144
Member Since:
February 21, 2014
sp_UserOfflineSmall Offline

I do see the point you made. Even though the DI application example is a bit ‘exotic’, the use case does exist indeed.

Meanwhile I wrote a custom “deleteWithChildren(…)” method which browses for HasChild and Organizes reference targets recursively. (pretty similar to the SDK methods).

Thanks,
Hans-Uwe

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
10 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: 737

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1524

Posts: 6450

Newest Members:

fannielima, kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger, howardkennerley

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0

Administrators: admin: 1