Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » OCL audit rule message not displayed(OCL rule in GMF doesn't show a message when breaking this rule, although the OCL code is executed.)
OCL audit rule message not displayed [message #1734330] Tue, 07 June 2016 08:47
Alexandre Honorat is currently offline Alexandre HonoratFriend
Messages: 8
Registered: February 2016
Junior Member
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>


Previous Topic:GMF editor - Mouse cursor is opaque - How to make it transparent
Next Topic:How to Generate notation model for a domain model
Goto Forum:
  


Current Time: Fri Apr 26 10:21:09 GMT 2024

Powered by FUDForum. Page generated in 0.02856 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top