cancel
Showing results for 
Search instead for 
Did you mean: 

integrity error when using association <taget><many

friedman30
Champ in-the-making
Champ in-the-making
I'm experiencing a strange behavior after defining a new type.
I've added this code to customModel.xml

<type name="custom:Team">
            <title>Team</title>
             <parent>cm:content</parent>
             <properties>
                  <property name="custom:TeamName">
                      <title>Team Name</title>
                      <type>d:text</type>
                  </property>
             </properties>
             <associations>
                  <association name="custom:Player">
                     <title>Players</title>
                     <source>
                      <many>true</many>
                   </source>
                     <target>
                        <class>cm:content</class>
                        <mandatory>false</mandatory>
                         <many>true</many>
                     </target>
                    </association>
          </associations>
</type>

when i'm adding an association, and then deleting it and confirming the deletion, i get this error:

ERROR [org.alfresco.repo.node.integrity.IntegrityChecker] Found 1 integrity violations:
The association source multiplicity has been violated:
   Association: Association[ class=ClassDef[name={custom.model}Team], name={custom.model}Player, target class={http://www.alfresco.org/model/content/1.0}content, source role=null, target role=null]
   Required source Multiplicity: 1..*
   Actual source Multiplicity: 0

Is this a bug in alfresco?  :shock:
If not - how can i fix this ?

thanks,

Dror
2 REPLIES 2

ale_carraro
Champ in-the-making
Champ in-the-making
try to put <mandatory>false</mandatory>  also in source element

friedman30
Champ in-the-making
Champ in-the-making
ale_carraro you are absolutely right     Smiley Happy

THANKS!!!!

Dror