Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » How to create a reference to an element in another model?(metamodel reference package emf allContents allInstances)
How to create a reference to an element in another model? [message #1803556] Mon, 04 March 2019 08:34 Go to next message
Mars Keez is currently offline Mars KeezFriend
Messages: 16
Registered: January 2015
Junior Member
Hi y'all

I have 2 models A and B of 2 different metamodels in 2 packages (without common root package). In order to access elements of A from B, I want to set a reference from some element in B to the root container in A.

How can I achieve this? Is there some sth. like "get all elements of type A::..."?
Checked AQL. Haven't seen anything alike. Of course have tried allInstances(), but always returns 0 size sequence (in the interpreter).

So long
make



[Updated on: Mon, 04 March 2019 20:03]

Report message to a moderator

Re: How to create a reference to an element in another model? [message #1803643 is a reply to message #1803556] Wed, 06 March 2019 02:13 Go to previous messageGo to next message
argaz amazigFriend
Messages: 28
Registered: November 2018
Junior Member
Hi,

I'm not sure that I really know what you want to do but why not import the package A in B at the meta model level or just define these two .ecore files as the source meta-model of your Sirius diagram

[Updated on: Wed, 06 March 2019 17:35]

Report message to a moderator

Re: How to create a reference to an element in another model? [message #1803670 is a reply to message #1803643] Wed, 06 March 2019 14:22 Go to previous messageGo to next message
Julien Dupont is currently offline Julien DupontFriend
Messages: 155
Registered: July 2009
Senior Member
Dear Mars,

Do you have a link between your metamodel A and your metamodel B?
If you have a link between both, you must to add A and B metamodel in the tab metamodels of your odesign in the graphical description.
After you will define a mapping for a instance object and a mapping for b instance object.
The last action consist to find the relation in metamodel A that have a link with metamodel B and to use this relation in Sirius.

If not you must to explain to Sirius how to create a link between the a instance object and the b instance object.

Regards,
Re: How to create a reference to an element in another model? [message #1803681 is a reply to message #1803670] Wed, 06 March 2019 17:06 Go to previous message
Mars Keez is currently offline Mars KeezFriend
Messages: 16
Registered: January 2015
Junior Member
Hi Julien, Argaz

I have a reference "erm" in the metamodel - as in the image attached - that I want to instanciate automatically, when I create a "Context" element, assumed an ERM instance already exists. CXM and ERM are the root elements of the two metamodels, in the packages er3 and cx4.

I don't want to force the user to create this link manually, since forgetting it can lead to heavy inconsitencies in the model (nasty things like view element without semantic element, that are hard to fix)

Regards
make

ps
I've also added the metamodels (properly) to each diagram in odesign.

  • Attachment: cxm-erm.jpg
    (Size: 26.99KB, Downloaded 32 times)
Previous Topic:Sirius Model - OPC UA Connection
Next Topic:Creation of two labels
Goto Forum:
  


Current Time: Wed Nov 13 18:06:30 GMT 2019

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

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

Back to the top