Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Copying/Moving items(What is the correct way to copy or move items?)
Copying/Moving items [message #1818828] Mon, 30 December 2019 07:38 Go to next message
Avi Shaked is currently offline Avi ShakedFriend
Messages: 117
Registered: October 2019
Senior Member
Hi,

I was trying to move model entities that were located under one component - ComponentA (as a package) to another component ComponentB. I did it using the "resource set" view of my model. However, when I moved the items, all the diagrams that were located under ComponentA were lost.

What is the correct way to copy/move partial/entire content of a "packaging" model element?

Thank you!
Re: Copying/Moving items [message #1818841 is a reply to message #1818828] Mon, 30 December 2019 10:08 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 492
Registered: May 2011
Senior Member
Hello,

Indeed, as the diagrams are located in the aird file and referencing ComponentA as their semantic root, when you moved all the element, the diagrams now become empty. In the same way, if you already had created a diagram on ComponentB, all the elements would have appeared (assuming that your diagram is as default a synchronized diagram). This is the expected behavior.
Now if you do this operation a lot and want to move the diagram as well, then you can add to the session event broker (org.eclipse.sirius.business.api.session.Session.getEventBroker()) a new ModelChangeTrigger (addLocalTrigger) with a notification filter scope set to listen to Move notification on your semantic elements. The action of this trigger would be to create a new representation on the target new container.

Best regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Copying/Moving items [message #1818867 is a reply to message #1818841] Tue, 31 December 2019 07:25 Go to previous messageGo to next message
Avi Shaked is currently offline Avi ShakedFriend
Messages: 117
Registered: October 2019
Senior Member
Thank you Steve.

Isn't there a built-in mechanism to copy/move data within a model?
seems like a basic requirement from a modeling tool...

Regards,
Avi
Re: Copying/Moving items [message #1818873 is a reply to message #1818867] Tue, 31 December 2019 09:21 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 492
Registered: May 2011
Senior Member
Hello,

Not in your case because you are moving the content of the (root) semantic element that your diagram targets, ComponentA. If you had moved ComponentA, then the diagram would have "followed" because it would still references ComponentA.
It is not a default behaviour when moving elements to check if there is a representation that has no elements to display anymore and create a new representation automatically. You can add this as I presented before, but this is not default. What should be done if you move only part of the elements under ComponentA? If there are elements under ComponentB? If there are other diagram there. I see why your idea to automatically create the diagram is interesting, but it is a custom requirement. Some user will not want to see diagram be created when the refactor the semantic model I think.

Best regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Copying/Moving items [message #1818875 is a reply to message #1818873] Tue, 31 December 2019 09:47 Go to previous messageGo to next message
Avi Shaked is currently offline Avi ShakedFriend
Messages: 117
Registered: October 2019
Senior Member
Thank you Steve.

I fully understand your perspective. I believe it originates in the underlying approach of Sirius' synchronized diagrams and the "packaging" of elements according to their model structure.

However, in unsynchronized diagrams (and in other tools such as Enterprise Architect) a diagram/package does not necessarily indicate a relationship or model functionality. The content of the diagram specifies the model.

Regardless, I see a prominent use case in what I described as a user: provided that two components are semantically identical (they are represented by the same class in the meta-model), I see no reason why the complete content of one component cannot be moved or duplicated to another component. It is a matter of helping the user so that instead of creating two identical components and two identical diagrams he/she can create just one and copy the same design to another. This is also true when one wants to "refactor": assume that a full design of ComponentA which is a component of topComponent (2 level hierarchy) was made using diagrams, and now we want to change that design so that ComponentA is a component of ComponentB which is a component of topComponent (3 level hierarchy). There is no reason why ComponentA, with its complete design (diagrams included) is not transferable to ComponentB (provided ComponentB allows composition by components). The fact is - it is transferable, except for the diagrams that get lost (without notification).

Just some constructive feedback for improvement...

Regards and thanks again!
Re: Copying/Moving items [message #1818878 is a reply to message #1818875] Tue, 31 December 2019 14:16 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 492
Registered: May 2011
Senior Member
I see your point. In my opinion it is a pretty specific need, but I might be biased so I will talked about it to the rest of the team after the holidays.

Thanks for your feedback.
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Copying/Moving items [message #1818954 is a reply to message #1818878] Fri, 03 January 2020 10:15 Go to previous message
Avi Shaked is currently offline Avi ShakedFriend
Messages: 117
Registered: October 2019
Senior Member
Thank you Steve.
I highly appreciate it!
Previous Topic:Are Sirius and EMF Forms mutually exclusive?
Next Topic:XMI compatibility
Goto Forum:
  


Current Time: Mon Nov 30 02:40:57 GMT 2020

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

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

Back to the top