Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Model change validation
Model change validation [message #1695779] Tue, 19 May 2015 09:00 Go to next message
Bernhard Edler is currently offline Bernhard EdlerFriend
Messages: 6
Registered: August 2014
Junior Member
I am using Sirius with an Xtext DSL. In the event of changes to the semantic model, I need to be able to manually validate the change and, if necessary add my own subsequent changes to the model.

E.g. if the datatype of an attribute in my class diagram is set or changed (see attached picture), I need to make sure the containing package is aware of the datatype or, if not, manually imports it.

How can I access these changes programmatically and perform my validations/additions?


regards,

Bernhard
Re: Model change validation [message #1696057 is a reply to message #1695779] Thu, 21 May 2015 12:59 Go to previous messageGo to next message
Koen Staal is currently offline Koen StaalFriend
Messages: 70
Registered: October 2014
Member
when generating the model you also generate your.project.model.edit. In this project you can find the classes that are used for the properties tab. If you change a method dont forget to replace @generated with "@generated NOT", otherwise it gets replaced on a new generation.
Re: Model change validation [message #1696451 is a reply to message #1695779] Tue, 26 May 2015 14:20 Go to previous message
Esteban Dugueperoux is currently offline Esteban DugueperouxFriend
Messages: 472
Registered: July 2009
Senior Member
Hi Bernhard,

If you want to react to model changes to do other model changes, you can
use a precommit listener [1] and if the changes doesn't comply to your
validation rules you can throw a RollbackException to have changes undone.

[1]
http://download.eclipse.org/modeling/emf/transaction/javadoc/1.1.3/org/eclipse/emf/transaction/ResourceSetListener.html
[2]
http://www-01.ibm.com/support/knowledgecenter/SSCLKU_7.5.5/com.ibm.xtools.modeler.doc.isv/prog-guide/listening.html

Le 19/05/2015 15:08, Bernhard Edler a écrit :
> I am using Sirius with an Xtext DSL. In the event of changes to the semantic model, I need to be able to manually validate the change and, if necessary add my own subsequent changes to the model.
>
> E.g. if the datatype of an attribute in my class diagram is set or changed (see attached picture), I need to make sure the containing package is aware of the datatype or, if not, manually imports it.
>
> How can I access these changes programmatically and perform my validations/additions?
>
>
> regards,
>
> Bernhard
>

--
Esteban Dugueperoux - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Change Diagram Representations Within a Single Editor
Next Topic:Diagrams based on multiple/shared resource
Goto Forum:
  


Current Time: Fri Apr 26 17:46:42 GMT 2024

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

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

Back to the top