AnsweredAssumed Answered

Help in using CMLCreateAssociation

Question asked by anshul on Feb 1, 2011
Latest reply on Feb 8, 2011 by openpj
I am trying to create peer association between two nodes . Following is my code

         Predicate predicate_epubFile=new Predicate(new Reference[]{ref_epubFile},storeRef, null);
         Predicate predicate_epubCoverImage=new Predicate(new Reference[]{ref_epubImage},storeRef,null);

         CMLCreateAssociation createAssociation=new CMLCreateAssociation(predicate_epubFile,null,predicate_epubCoverImage,null,Constants.ASSOC_CONTAINS);
         cml = new CML();
         cml.setCreateAssociation(new CMLCreateAssociation[]{createAssociation});
         catch(RepositoryFault e)

This is Giving following Exception
org.alfresco.repo.node.integrity.IntegrityException: 01010388 Found 1 integrity violations:
The association source type is incorrect:
   Source Node: workspace://SpacesStore/27aedefe-eeb9-45d3-a0b8-99c8cd8b7941
   Association: Association[ class=ClassDef[name={}folder], name={}contains, target class={}base, source role=null, target role=null]
   Required Source Type: {}folder
   Actual Source Type: {}content

What i am doing wrong here.
Please help
Thank you