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

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

description="Check name uniqueness."
message="Actor's name must be non-empty and unique in the graph.">
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)"/>

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">
<constraintProvider cache="true">
<package namespaceUri=""/>
<constraints categories="ADFGAuditContainer">
<constraint id="ActorValidName"
severity="ERROR" statusCode="200">
<![CDATA[not self.Name.oclIsUndefined()
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"/>

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: Sat Apr 13 20:22:45 GMT 2024

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

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

Back to the top