Skip to main content



      Home
Home » Eclipse Projects » Sirius » Model change validation
Model change validation [message #1695779] Tue, 19 May 2015 05:00 Go to next message
Eclipse UserFriend
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 08:59 Go to previous messageGo to next message
Eclipse UserFriend
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 10:20 Go to previous message
Eclipse UserFriend
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: Tue May 13 22:55:41 EDT 2025

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

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

Back to the top