AnsweredAssumed Answered

Association mandatory problem

Question asked by theterz on Dec 19, 2013
Latest reply on Dec 23, 2013 by mitpatoliya
Hi all,
I have a problem with a mandatory association.

I have create a model with an aspect that has more properties and an association (target cm:person).
With a rule definded on a folder I apply aspect to all documents uploaded to the folder.
I'd like this association was mandatory but If I defined it as

                <association name="custom:field1">
                    <source>
                        <mandatory>true</mandatory>
                        <many>true</many>
                    </source>
                    <target>
                        <class>cm:person</class>
                        <mandatory>true</mandatory>
                        <many>false</many>
                    </target>
                </association>

user get error when try to upload a file:
Operazione non riuscita: Found integrity violations:
The association target multiplicity has been violated:
   Source Node: workspace://SpacesStore/e0ff6142-cedb-493f-9171-ee64743fedcf
   Association: Association[ class=ClassDef[name={custom}corrIn], name={custom}CorrInDest, target class={http://www.alfresco.org/model/content/1.0}person, source role=null, target role=null]
   Required target Multiplicity: 1..1
   Actual target Multiplicity: 0

Instead, if I defined my aspect as

                <association name="custom:field1">
                    <source>
                        <mandatory>true</mandatory>
                        <many>true</many>
                    </source>
                    <target>
                        <class>cm:person</class>
                        <mandatory>false</mandatory>
                        <many>false</many>
                    </target>
                </association>

user can upload document but when he edits properties field may be empty.
Do you have any suggestions

Outcomes