AnsweredAssumed Answered

Mandatory association problem

Question asked by tomasp on Jan 26, 2012
Latest reply on Apr 7, 2014 by mirko79_9866
I'm trying to model mandatory association with enforced="false". I created new type with association "Designer". On every document of this type the designer association must be filled.

I want to upload document of my new type. During the upload I can't fill properties and associations, so I declared all mandatory properties and associations as enforced="false". It works perfectly for properties. Document is uploaded and saved without mandatory fields. And when I edit metadata, I must fill mandatory properties.

But when I declared association as mandatory, enforced="false", the document is never uploaded:
16:17:38,108 User:admin ERROR [node.integrity.IntegrityChecker] Found 1 integrity violations:
The association target multiplicity has been violated:
   Source Node: workspace://SpacesStore/8f79bc3c-bebe-4fba-a87d-bdb257261b7f
   Association: Association[ class=ClassDef[name={}ProductData], name={}Designer, target class={}person, source role=null, target role=null]
   Required target Multiplicity: 1..1
   Actual target Multiplicity: 0

It seems like Alfresco don't care about enforced="false" within association declaration.

my model snipped:

<association name="foo:Designer">
      <mandatory enforced="false">true</mandatory>

Thanks for all suggestion,