OCL audit rule message not displayed [message #1734330] |
Tue, 07 June 2016 08:47 |
Eclipse User |
|
|
|
Hi,
I've created a simple audit rule in my gmfmap file (Eclipse Modeling Mars), its goal is to check the uniqueness of a Name attribute. I know this rule works fine in another proejct, under Eclipse Modeling Luna. But in my current project (with *Mars*), the rule is applied but doesn't display an error message as it should. I've written below the rule and the properties of the audit rule. Any idea why the error message wouldn't be displayed ?
I've also checked the presence of the message in the generated diagram code: it appears in the plugin.xml, at the org.eclipse.emf.validation.constraintProviders. It seems a bit old, maybe not maintained ?
----------------------------------
audit rue in gmfmap
---------------------------------
<audits
name="ActorValidName"
description="Check name uniqueness."
id="ActorValidName"
useInLiveMode="true"
message="Actor's name must be non-empty and unique in the graph.">
<rule
body="not self.Name.oclIsUndefined() and self.Name<> '' and self.graph.actors->forAll(a| (a.oclIsKindOf(Actor) and a<>self) implies a.oclAsType(Actor).Name<>self.Name)"/>
<target
xsi:type="gmfmap:DomainElementTarget">
<element
href="adfgGraphModel.ecore#//Actor"/>
</target>
</audits>
---------------------------------------------------------------------------------------
generated extension point in plugin.xml (of diagram code)
---------------------------------------------------------------------------------------
<extension point="org.eclipse.emf.validation.constraintProviders">
<?gmfgen generated="true"?>
<category id="ADFGAuditContainer" mandatory="false" name="ADFGAuditContainer">
<![CDATA[]]>
</category>
<constraintProvider cache="true">
<package namespaceUri="http://www.example.org/adfgGraphModel"/>
<constraints categories="ADFGAuditContainer">
<constraint id="ActorValidName"
lang="OCL"
name="ActorValidName"
mode="Live"
severity="ERROR" statusCode="200">
<![CDATA[not self.Name.oclIsUndefined()
and
self.Name <> '' and
self.graph.actors->forAll(a| (a.oclIsKindOf(Actor) and a<>self) implies a.oclAsType(Actor).Name<>self.Name)]]>
<description><![CDATA[Check name uniqueness.]]></description>
<message><![CDATA[Actor's name must be non-empty and unique in the graph.]]></message>
<target class="adfgGraphModel.Actor"/>
</constraint>
...
</constraints>
</constraintProvider>
</extension>
|
|
|
Powered by
FUDForum. Page generated in 0.03263 seconds