cancel
Showing results for 
Search instead for 
Did you mean: 

add several time the same aspect : association

isy
Champ in-the-making
Champ in-the-making
Hello,

I would like to add several time an aspect to a person. A person can be absent several time and assign someone to do his tasks during this period.

For the moment i can have only one absence with this :

<aspects>
      <aspect name="ex:absence">
         <title>Person absence</title>
         <properties>
            <property name="ex:start">
               <title>Start date</title>
               <type>d:date</type>
            </property>

            <property name="ex:end">
               <title>End date</title>
               <type>d:date</type>
            </property>
         </properties>

         <associations>
            <association name="ex:delegatePerson">
               <source>
                  <mandatory>false</mandatory>
               </source>
               <target>
                  <class>cm:person</class>
                  <mandatory>true</mandatory>
                  <many>false</many>
               </target>
            </association>
         </associations>
      </aspect>
   </aspects>



Can someone show me an example ?
Thx in advance
2 REPLIES 2

rjohnson
Star Contributor
Star Contributor
You can only add an aspect once.

One solution would be to have a single aspect called absence records, which just has an association called ex:absences to documents of type ex:absencerecord. Create a new document type called ex:absencerecord with properties  properties ex:startabsence, ex:endabsence, ex:delegatePerson. Then add an associated ex:absencerecord document for each absence. You can create the ex:absencerecord as a document without content in javascript.

Bob Johnson

isy
Champ in-the-making
Champ in-the-making
Thank you for the answer Bob Smiley Happy