AnsweredAssumed Answered

Association integrity?

Question asked by mchernecki on Apr 18, 2007
I am getting "source multiplicity has been violated" errors when I add an associated document. Perhaps I have defined my model incorrectly? I have 2 content types, an invoice type and a purchase order type. Each invoice is associated with one purchase order. Each purchase order may have many associated invoices. I have defined my assciations as follows.

Invoice

         <associations>
            <association name="ap:matchingpo">
               <title>Purchase Order</title>
               <target>
                  <class>ap:purchaseorder</class>
                  <mandatory>false</mandatory>
                  <many>false</many>
               </target>
            </association>
         </associations>

Purchase Order

         <associations>
            <association name="ap:poinvoices">
               <title>Invoices</title>
               <target>
                  <class>ap:invoice</class>
                  <mandatory>false</mandatory>
                  <many>true</many>
               </target>
            </association>
         </associations>

I have created a purchase order and added 3 associated invoices. I go to each of the invoices to add the purchase order association. The first I add is fine, but when I go to add the second I get the integrity error. What did I do wrong?

Also, do I need to maintain this two way association. I want to be able to open any purchase order and see the list of invoice or open any invoice to see the purchase order. Does alfresco automatically maintain the association on the associated documents details?

Outcomes