cancel
Showing results for 
Search instead for 
Did you mean: 

associations

turgayz
Champ in-the-making
Champ in-the-making
Hi,
I am confused about associations. Can you please tell me when should I create an "association", and in which case it should be a "child-association"?

I am trying to create a model, in which a "taskList" can have lots of "task"s.

Should I define it like:

<type name="tl:taskList">
         <parent>cm:folder</parent>
         <associations>
            <association name="tl:taskOfTaskList">
               <target>
                  <class>tl:task</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
            </association>
         </associations>
      </type>

or like:

<type name="tl:taskList">
         <parent>cm:folder</parent>
         <associations>
            <child-association name="tl:taskOfTaskList">
               <target>
                  <class>tl:task</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
            </child-association>
         </associations>
      </type>

Is there an example describing when to use association and when to use child-association?
1 REPLY 1

rwetherall
Confirmed Champ
Confirmed Champ
Hi,

A child association is used when there is a hierarchy between the associated nodes

An association is simply a link between two nodes and does not imply the same parent/child relationship.

Since, I presume, a task has a parent/child relationship with a task list then you should use a child association in this situation.

Hope this helps,
Roy