Mandatory Association with relaxed mode
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2014 03:46 AM
On http://docs.alfresco.com/4.2/concepts/metadata-model-assoc.html it says:
<blockquote>
As with mandatory properties, both enforced and relaxed modes are supported for the target end, allowing control over whether a transaction can commit or not based on missing associations.
</blockquote>
The XML Schema does not have any property to configure relaxed mode for a mandatory assoziation.
What am I missing? Is the documentation wrong in this point?
<blockquote>
As with mandatory properties, both enforced and relaxed modes are supported for the target end, allowing control over whether a transaction can commit or not based on missing associations.
</blockquote>
The XML Schema does not have any property to configure relaxed mode for a mandatory assoziation.
What am I missing? Is the documentation wrong in this point?
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2014 05:34 AM
Enforced and relaxed modes are configured using enforced attribute of mandatory sub element ,it is defined as following in modelschema.xsd
In model definition ,it will be like following
<xs:complexType name="mandatoryDef" mixed="true"> <xs:attribute name="enforced" use="optional" type="xs:boolean"/> </xs:complexType>
In model definition ,it will be like following
<association name="**:***"> <source> <mandatory>false</mandatory> <many>true</many> </source> <target> <class>**:***</class> <mandatory enforced="false">true</mandatory> <many>false</many> </target></association>
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2014 06:57 AM
Setting
<blockcode>
<association name="ns:assoc">
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>cm:cmobject</class>
<mandatory enforced="false">true</mandatory>
<many>true</many>
</target>
</association>
</blockcode>
produces this error:
<blockcode>
The association target multiplicity has been violated:
Source Node: workspace://SpacesStore/ddf1f030-3e72-4a08-b21c-e5aee44b2d3b
Association: Association[ class=ClassDef[name={http://example.com/model/ns/1.0}Aspect], name={http://example.com/model/ns/1.0}assocs, target class={http://www.alfresco.org/model/content/1.0}cmobject, source role=null, target role=null]
Required target Multiplicity: 1..*
Actual target Multiplicity: 0
</blockcode>
I can't find any working example of
enforced="true"
does not have any effect. This association (with dummy namespace and names)<blockcode>
<association name="ns:assoc">
<source>
<mandatory>false</mandatory>
<many>true</many>
</source>
<target>
<class>cm:cmobject</class>
<mandatory enforced="false">true</mandatory>
<many>true</many>
</target>
</association>
</blockcode>
produces this error:
<blockcode>
The association target multiplicity has been violated:
Source Node: workspace://SpacesStore/ddf1f030-3e72-4a08-b21c-e5aee44b2d3b
Association: Association[ class=ClassDef[name={http://example.com/model/ns/1.0}Aspect], name={http://example.com/model/ns/1.0}assocs, target class={http://www.alfresco.org/model/content/1.0}cmobject, source role=null, target role=null]
Required target Multiplicity: 1..*
Actual target Multiplicity: 0
</blockcode>
I can't find any working example of
<mandatory enforced="false">true</mandatory>
. Is this actually working?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2014 08:43 AM
I consider this a bug and have created a ticket: https://issues.alfresco.com/jira/browse/ALF-21097
