Skip to Content
author's profile photo Former Member
Former Member

Cardinality of a value node

Dear friends,

When I create a value node in the context controller why should I change its cardinality to 1..1 and not to keep it as the default one 0..n? And what will happen if I leave it unchanged?

I really want to understand that from the runtime data point of view.

regards,

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 07, 2008 at 08:56 AM

    Hi Hisham,

    Cardinality:

    Any node or attribute that has the context root node as its immediate parent, is known as an independent node or attribute.

    Any node or attribute that has some other node as its immediate parent, is known as a dependent node or attribute.

    All context nodes are collections.

    A node collection is composed of elements, where an element is an aggregation of the node’s immediate children (attributes and/or other nodes).

    The cardinality property controls the number of elements a node collection may hold at runtime.

    Every context node has a property called Cardinality. This property is composed of two values that taken together, describe the maximum and minimum number of elements the node collection may hold

    at runtime.

    Therefore, there are four possible cardinality values (specified as <Min>..<Max>)

    0:1: At most one element can be selected

    1:1: Exactly one is selected

    0:N: Any number of elements can be selected

    1:N: At least one ...

    The first two values define a node with single-selection. The second two values define a node with multi-selection.

    Like if you have input field , in that case if you are binding it with the value node then you need cardinality as 1:1/1:n.

    The reason is that it will create an element always for you so that you can give some input in this element.

    If you set the cardinality to 0:1/0:n then it will disable the input field and user will not be able to enter the data.

    Thanks n Regards,

    Jhansi Miryala

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 07, 2008 at 09:19 AM

    1:1 value nodes come handy for grouping attributes that semantically belong together. Another common use-case is to add additional attributes to nodes with structure binding where this is not possible directly. In that case these additional attributes are added to a 1:1 value (sub-)node.

    When cardinality is 1:* the framework automatically creates a node element.

    Armin

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 07, 2008 at 10:10 AM

    Thanks to Armin Reichert & Jhansi Miryala for their response and valuable explanations. I really got it clear.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.