cancel
Showing results for 
Search instead for 
Did you mean: 

Question regarding IWDTree and context Value Node naming

Qualiture
Active Contributor
0 Kudos

Hi,

I have a question regarding the IWDTree / IWDTreeNodeType components.

I have a context looking like this:


Context
  + ResponseNode
    + PersonNode (1..1)
      + PersonAddressNode                    (empty node, placeholder)
      | + AdresNode (0..n)
      + PersonChildNode                      (empty node, placeholder)
      | + PersonNode (0..n)
      |   + PersonAddressNode                (empty node, placeholder)
      |     + AddressNode (0..n)
      + PersonParentsNode                    (empty node, placeholder)
        + PersonNode (0..n)
          + PersonAddressNode                (empty node, placeholder)
            + AddressNode (0..n)

The context represents a person, a person's address, and a person's children and parents with their respective addresses.

As a result, on different branches, a PersonNode and AddressNode can appear.

And for some strange reason, all PersonNodes and AddressNodes link to the same ResponseNode.PersonNode.PersonParentsNode.PersonNode and ResponseNode.PersonNode.PersonParentsNode.PersonNode.PersonAddressNode.AddressNode respectively, irregardless of their branch...

Is it illegal to have multiple PersonNode and AddressNode node names, and should they be named uniquely?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Generally, node names need to be unique inside the context, attributes in different nodes can have same names. I wonder if the context structure you described will result in code without compile errors.

The WD Tree can only be used with recursive context nodes or with a hierarchy of non-singleton child nodes.

Can you give an example how your tree should look like at runtime?

Qualiture
Active Contributor
0 Kudos

I am using non-singleton value nodes, created at runtime.

I did not get any runtime errors regarding the context naming/hierarchy, but did suffer from the aforementioned issues.

I bypassed my problem by using unique names. Thanks for all the helpfull pointers anyway

junwu
Active Contributor
0 Kudos

hava you tried recursive node?

Qualiture
Active Contributor
0 Kudos

Unfortunately, a recursive node is not an option because it isn't truly recursive (the placeholder nodes in between)