AnsweredAssumed Answered

Child Association

Question asked by yogeshkumar on Dec 30, 2010
Hi ,

I am working on child association, i am getting error like

The association parent multiplicity has been violated:
   Target Node: workspace://SpacesStore/6ab97a34-f8c0-45c6-82cf-271e5de899b3
   Association: Association[ class=ClassDef[name={test.be}Testing], name={test.be}complaintItemsAssoc, target class={test.be}testtype, source role=null, target role=null]
   Required parent Multiplicity: 1..1
   Actual parent Multiplicity: 0



Please find my model below.

<types>
<!– Enterprise-wide generic document type –>
<type name="test:Testing">
<title>sample testing</title>
<parent>cm:content</parent>
<properties>
            <property name="test:currentid">
               <type>d:text</type>
            </property>
</properties>
<associations>
<child-association name="test:complaintItemsAssoc">
<title>Complaint Items</title>
<source>
<mandatory>true</mandatory>
<many>false</many>
</source>
<target>
<class>test:testtype</class>
<mandatory>false</mandatory>
<many>false</many>
</target>
<duplicate>false</duplicate>
</child-association>
</associations>
</type>

<type name="test:testtype">
<title>sample testing</title>
<parent>test:Testing</parent>
<properties>
            <property name="test:testid">
               <type>d:text</type>
            </property>
</properties>
</type>

please find my code.

Reference[] docRefTarget = new Reference[]{new Reference(storeRef,"9b7fa3de-53b2-4b6e-86b5-a4c02d41afc6",null)};
   Reference[] docRefSource = new Reference[]{new Reference(storeRef,"6ab97a34-f8c0-45c6-82cf-271e5de899b3",null)};
   final Predicate sourcePredicatess = new Predicate(docRefSource, null, null);
   final Predicate targetPredicatess = new Predicate(docRefTarget, null, null);

CMLCreateAssociation relatedDocAssoc = new CMLCreateAssociation(
         sourcePredicatess, null ,
         targetPredicatess,
         null ,"{test.be}complaintItemsAssoc");
   

Please help me in fixing the same




Thanks and Regards,
Yogeshkumar.S

Outcomes