Java Reference
In-Depth Information
Figure 4-16
Mindmap validation constraint preferences
Note that audits and metrics defined using GMF are GMF-specific only
when they're written against the notation model. Otherwise, the generated code
can be refactored for use in the domain model without a diagram. You will find
the Validation Framework quite useful, particularly considering the extensibility
provided with its declarative nature. You can add other audits and metrics by
augmenting the generated plugin.xml file, or even from another plug-in. This
is how our earlier audits and metrics are declared, not including the decorator
and marker declarations:
<extension point="org.eclipse.emf.validation.constraintProviders">
<?gmfgen generated="true"?>
<category id="mindmap.audits" mandatory="false"
name="Mindmap Audits">
<![CDATA[A set of mindmap model audits.]]>
</category>
<constraintProvider cache="true">
<package namespaceUri="http://www.eclipse.org/2008/mindmap"/>
<constraints categories="mindmap.audits">
<constraint id="cycle"
lang="OCL"
name="Subtopic Cycle"
mode="Batch"
severity="WARNING" statusCode="200">
<![CDATA[not self->closure(subtopics)->includes(self)]]>
<description><![CDATA[Topics should not have subtopic
relationships that form a cycle. ]]>
</description>
<message><![CDATA[A cycle was detected in the subtopics of
this Topic.]]>
</message>
<target class="mindmap.Topic"/>
</constraint>
Search WWH ::




Custom Search