AnsweredAssumed Answered

Mandatory target of an association and integrity check

Question asked by jayjayecl on Mar 12, 2010
Latest reply on Apr 17, 2012 by mjboere
I am facing a problem I don't know how to manage.
The fact is that I have an aspect defining an association whose target is mandatory :

<aspect name="custom:associations">
<association name="custom:assocCategory">

The problem is that I cannot add this aspect to any document (using the "run action" wizard), because Alfresco raises an Integrity error (see stacktrace attached).
I do understand why the integrity check fails (the association is mandatory, but at the moment of adding the aspect, there is no target registered in the association).
However, if you define, in the custom model, a mandatory text property, you can still add the aspect, even if the property is not set yet.

What workaround would be best for me :
- I need to define an association to a category target
- I need to make it mandatory, so that on the "edit properties" form, a user cannot validate it if the association has not been filled.

Thank you