Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Edapt] DiagnosticException on an example migration
[Edapt] DiagnosticException on an example migration [message #1229876] Fri, 10 January 2014 12:27 Go to next message
Pascal Gula is currently offline Pascal GulaFriend
Messages: 5
Registered: November 2013
Junior Member
Hi,
I am trying to run a small test on the library example to validate the migration feature of Edapt. I will describe my steps but the result of the execution is the following. When trying to open the old model, a dialog is asking me if I want to do the migration as expected but the result of it end with the following exception:
"Caused by: org.eclipse.emf.edapt.migration.DiagnosticException: Model inconsistent
The 'validContainment' constraint is violated on 'Instance of type "Employee"'
The 'validContainment' constraint is violated on 'Instance of type "Writer"'"

Here are the steps I took:
- add a history to the current ecore
- create a first release of this ecore
- launch the project and creating a model base on the first release of the metamodel
- perform basic modification by renaming 2 attributes firstName->fName and lastName->lName, which would lead 100% to a migration state
- increment nsURI to a new version, v1.0.1
- add an extensions of migrators to the editor plugin and giving the history as value to the property (not sure to be right at this point)
- insert the check/performMigration in the createModel method
- launch the project again and try to open the old model

Attached the different projects.

Did I miss a major step?

Cheers,
Pascal
Re: [Edapt] DiagnosticException on an example migration [message #1229897 is a reply to message #1229876] Fri, 10 January 2014 13:44 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
On 10-01-14 13:27, Pascal Gula wrote:
> Hi,
> I am trying to run a small test on the library example to validate the migration feature of Edapt. I will describe my steps but the result of the execution is the following. When trying to open the old model, a dialog is asking me if I want to do the migration as expected but the result of it end with the following exception:
> "Caused by: org.eclipse.emf.edapt.migration.DiagnosticException: Model inconsistent
> The 'validContainment' constraint is violated on 'Instance of type "Employee"'
> The 'validContainment' constraint is violated on 'Instance of type "Writer"'"
>
Edapt validates the migrated model after applying the changes. As it
constructs the EPackage in memory and migrates an actual model in memory
it is needed to produce a succesfull output. In this case one of your
instanceof Employee is has a non valid containment. This could simply be
a model which is different then what Edapt expects at this point in
time. (Depending on the release for which the model was based). I would
recommend you check if your model instance really complies to the first
release of your ecore.

> Here are the steps I took:
> - add a history to the current ecore
> - create a first release of this ecore
> - launch the project and creating a model base on the first release of the metamodel
> - perform basic modification by renaming 2 attributes firstName->fName and lastName->lName, which would lead 100% to a migration state
> - increment nsURI to a new version, v1.0.1
> - add an extensions of migrators to the editor plugin and giving the history as value to the property (not sure to be right at this point)
> - insert the check/performMigration in the createModel method
> - launch the project again and try to open the old model
>
> Attached the different projects.
>
> Did I miss a major step?
I will need to check your project and see if I can reproduce your problem.
>
> Cheers,
> Pascal
>
Re: [Edapt] DiagnosticException on an example migration [message #1241047 is a reply to message #1229897] Fri, 07 February 2014 11:55 Go to previous message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
Hi Pascal,

Finally got a chance to look at your project.
It seems you haven't used the Operations viewer to apply your changes to
the metamodel. Hence, not Operation type changes are produced, and only
your metamodel will be migrated. Perhaps you should have a look at this
blog to understand the migrator:

http://modelmoo.blogspot.nl/


One thing I am puzzled about regarding Edapt. (Hey, I didn't build the
thing :P), is the fact that it's possible to create a history from the
ecore editor itself. I am not sure why this feature exists, as it will
not produce Change objects which allow an actual model to be migrated.
(Just the metamodel).


Could you try with the Operation Viewer.

Hope this helps,
Cheers Christophe



On 10-01-14 14:44, Christophe Bouhier wrote:
> On 10-01-14 13:27, Pascal Gula wrote:
>> Hi,
>> I am trying to run a small test on the library example to validate the
>> migration feature of Edapt. I will describe my steps but the result of
>> the execution is the following. When trying to open the old model, a
>> dialog is asking me if I want to do the migration as expected but the
>> result of it end with the following exception:
>> "Caused by: org.eclipse.emf.edapt.migration.DiagnosticException: Model
>> inconsistent
>> The 'validContainment' constraint is violated on 'Instance of type
>> "Employee"'
>> The 'validContainment' constraint is violated on 'Instance of type
>> "Writer"'"
>>
> Edapt validates the migrated model after applying the changes. As it
> constructs the EPackage in memory and migrates an actual model in memory
> it is needed to produce a succesfull output. In this case one of your
> instanceof Employee is has a non valid containment. This could simply be
> a model which is different then what Edapt expects at this point in
> time. (Depending on the release for which the model was based). I would
> recommend you check if your model instance really complies to the first
> release of your ecore.
>
>> Here are the steps I took:
>> - add a history to the current ecore
>> - create a first release of this ecore
>> - launch the project and creating a model base on the first release of
>> the metamodel
>> - perform basic modification by renaming 2 attributes firstName->fName
>> and lastName->lName, which would lead 100% to a migration state
>> - increment nsURI to a new version, v1.0.1
>> - add an extensions of migrators to the editor plugin and giving the
>> history as value to the property (not sure to be right at this point)
>> - insert the check/performMigration in the createModel method
>> - launch the project again and try to open the old model
>>
>> Attached the different projects.
>>
>> Did I miss a major step?
> I will need to check your project and see if I can reproduce your problem.
>>
>> Cheers,
>> Pascal
>>
>
Previous Topic:[EMF Forms] How to embed a model view inside another model view
Next Topic:ECP 1.2 feedback
Goto Forum:
  


Current Time: Tue Apr 16 06:33:01 GMT 2024

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

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

Back to the top