Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Problems using our own Meta-Model
Problems using our own Meta-Model [message #1041661] Mon, 15 April 2013 11:39 Go to next message
Alexander Kipp is currently offline Alexander KippFriend
Messages: 1
Registered: April 2013
Junior Member
Hello everybody,
we have the following problem:
We want to add an eObject to our own Meta-Model with the following method:
laresModel.getBehDefs().add(newBehaviorDefinition);

This is working so far, but when we link it to the graphical representation in the Addfeature with the link method:
link(containerShape, addedDomainObject);

Then this additional line in the CreateFeature is necessary:
getDiagram().eResource().getContents().add(newBehaviorDefinition);

Otherwise the graphical representation is linked with null.
But this additional line causes our eObject (newBehaviorDefinition) to be removed from the laresModel.getBehDefs(), which is a part of our own Meta-Model.
Is there any way to keep the eObject in our own model and to link it to the graphical representation?
With best regards,
Alexander, Mario and Dominik
Re: Problems using our own Meta-Model [message #1042327 is a reply to message #1041661] Tue, 16 April 2013 09:29 Go to previous messageGo to next message
Andreas Graf is currently offline Andreas GrafFriend
Messages: 211
Registered: July 2009
Senior Member
Hi,

are both models' resources in the same ResourceSet?

Andreas
Re: Problems using our own Meta-Model [message #1042520 is a reply to message #1041661] Tue, 16 April 2013 14:25 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Alexander,

did you see this older forum entry?
http://www.eclipse.org/forums/index.php?t=msg&th=172247&start=0&S=acb08c1bf425f0ccb0106fb3a46a4bad

It deals with separating diagram and domain data into different resources.
Both resources would be loaded into the same reosurce set/editing doamin
inside your editor.

Michael
Re: Problems using our own Meta-Model [message #1043372 is a reply to message #1042327] Wed, 17 April 2013 16:12 Go to previous messageGo to next message
Mario Dally is currently offline Mario DallyFriend
Messages: 3
Registered: April 2013
Junior Member
Hi,

@Andreas: Never thought of that we´re having two models in use...
Can I replace the model of the tutorial with ours anyhow? Or is
it necessary to use both?

Thanks,
Mario
Re: Problems using our own Meta-Model [message #1043929 is a reply to message #1043372] Thu, 18 April 2013 09:26 Go to previous messageGo to next message
Andreas Graf is currently offline Andreas GrafFriend
Messages: 211
Registered: July 2009
Senior Member
In which resource is "laresModel"?
Re: Problems using our own Meta-Model [message #1043961 is a reply to message #1043929] Thu, 18 April 2013 10:13 Go to previous messageGo to next message
Mario Dally is currently offline Mario DallyFriend
Messages: 3
Registered: April 2013
Junior Member
We used the following to create an instance of our model (laresModel is the very top):

public void setRoot(LaresModel laresModel) {
	ResourceSet resSet = new ResourceSetImpl();
	Resource resource = resSet.createResource(URI.createURI("bla.xmi"));
	resource.getContents().add(laresModel);
	this.laresModel = laresModel;
}

This method is defined in an independent Singleton-Class in the project.
Re: Problems using our own Meta-Model [message #1044021 is a reply to message #1043961] Thu, 18 April 2013 11:58 Go to previous messageGo to next message
Andreas Graf is currently offline Andreas GrafFriend
Messages: 211
Registered: July 2009
Senior Member
At a quick glance, you are creating a dedicated ResourceSet for your laresModel. For cross-referencing to work, your resource should be created in the resourceSet of the Grpahiti Diagram. EMF only can cross ref models in the same resource set.
Re: Problems using our own Meta-Model [message #1044387 is a reply to message #1044021] Thu, 18 April 2013 21:18 Go to previous message
Mario Dally is currently offline Mario DallyFriend
Messages: 3
Registered: April 2013
Junior Member
Added laresModel to the e-resource of the diagram. Now the link-method is working fine with "newBehaviorDefinition" in laresModel!
Now I have to check out if this works with more than one diagram - using the drilldown-feature - as well.

Thanks a lot!!!

Mario
Previous Topic:Shared editing domains and dispose
Next Topic:Diagram disappears after saving when one tries to edit
Goto Forum:
  


Current Time: Thu Apr 18 05:46:56 GMT 2024

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

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

Back to the top