Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » How to migrate complex models(Flock fails to recognize objects with a foreign metamodel)
How to migrate complex models [message #794125] Wed, 08 February 2012 23:46 Go to next message
Mark Tippetts is currently offline Mark Tippetts
Messages: 25
Registered: July 2009
Junior Member
I have a metamodel that references several other metamodels. I want to evolve the metamodel to a new version. This works with a simple metamodel, i.e. one containing no references to other metamodels. But it breaks when I try to migrate models based on complex metamodels, i.e. ones with dependencies.

Let's assume the simplest possible case: The only change is to the NSURI, so I have an empty Flock file.

Simple example:
Original metamodel:
@namespace(uri="http://simplemetamodel/1.0", prefix="simplemetamodel")
package simplemetamodel;

class Something {
  attr String name;
}


Migrated Metamodel:
@namespace(uri="http://simplemetamodel/2.0", prefix="simplemetamodel")
package simplemetamodel;

class Something {
  attr String name;
}


Original model:
@Spec {
	metamodel "http://simplemetamodel/1.0" {
		nsUri: "http://simplemetamodel/1.0"
	}
}

package  {
	Something "Simple" {
		name: "Simple"
	}
}


Migrated model:
@Spec {
	metamodel "http://simplemetamodel/2.0" {
		nsUri: "http://simplemetamodel/2.0"
	}
}

package  {
	Something "Simple" {
		name: "Simple"
	}
}


Complex example:
External metamodel:
@namespace(uri="http://externalmetamodel/1.0", prefix="externalmetamodel")
package externalmetamodel;

class Peer {
  attr String name;
}


Original metamodel:
@namespace(uri="http://complexmetamodel/1.0", prefix="complexmetamodel")
package complexmetamodel;

import "platform:/resource/flock.update.example/model/ExternalMetamodel.ecore";

class Something {
  attr String name;
  ref externalmetamodel.Peer referenced;
}


Migrated metamodel:
@namespace(uri="http://complexmetamodel/2.0", prefix="complexmetamodel")
package complexmetamodel;

import "platform:/resource/flock.update.example/model/ExternalMetamodel.ecore";

class Something {
  attr String name;
  ref externalmetamodel.Peer referenced;
}


External model:
@Spec {
	metamodel "http://externalmetamodel/1.0" {
		nsUri: "http://externalmetamodel/1.0"
	}
}

package  {
	Peer "Foo" {
		name: "Foo"
	}
}


Original model:
@Spec {
	metamodel "http://complexmetamodel/1.0" {
		nsUri: "http://complexmetamodel/1.0"
	}
	
	metamodel "http://externalmetamodel/1.0" {
		nsUri: "http://externalmetamodel/1.0"
	}
}

package  {
	Something "Complex" {
		name: "Complex"
		referenced: Peer "PeerOne.model#_dMKaUFKZEeGB5seTnKLM5Q"
	}
}


Migrated model:
@Spec {
	metamodel "http://complexmetamodel/2.0" {
		nsUri: "http://complexmetamodel/2.0"
	}metamodel "http://externalmetamodel/1.0" {
		nsUri: "http://externalmetamodel/1.0"
	}
}

package  {
	Something "Complex" {
		name: "Complex"
	}
	Peer "Foo" {
		name: "Foo"
	}
}
package  {
}


As you can see, that's all wrong. Since the syntax of Flock remains somewhat undocumented, I'm hoping there's some simple workaround?

Regards,

Mark Tippetts
Re: How to migrate complex models [message #794759 is a reply to message #794125] Thu, 09 February 2012 17:13 Go to previous message
Louis Rose is currently offline Louis Rose
Messages: 440
Registered: July 2009
Location: York, United Kingdom
Senior Member
Hi Mark,

I'm sorry to read that you're having a problem with Flock. Thanks for providing an example of the problem behaviour; I'm sure I can help you to arrive at a solution.

I agree that Flock's current behaviour in this case doesn't seem to be at all sensible. I shall investigate, and get back to you tomorrow morning.

More soon,
Louis.
Previous Topic:[EOL][ETL] Specify Target Model during runtime
Next Topic:About ETL rules
Goto Forum:
  


Current Time: Thu Oct 02 10:43:01 GMT 2014

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

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