Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Flock reordering items when using opposite references in EMF
Flock reordering items when using opposite references in EMF [message #1847670] Wed, 03 November 2021 11:16 Go to next message
Justin Cooper is currently offline Justin CooperFriend
Messages: 6
Registered: August 2019
Junior Member
I'm seeing an issue when using opposite references in EMF models and migrating them using Flock.

Attached is a minimal example. In this example, we have Messages and Dataflows. A Message can carry multiple Dataflows, and a Dataflow can be carried by a single message.

In system.model, before any migration is run, the message carries dataflows in the order: Dataflow D2, Dataflow D1

Using the provided v1_to_v2.launch, when the migration is run, a new model is created system_mig.model. In this model, the message carries dataflows in the order: Dataflow D1, Dataflow D2.

My initial guess is that during the migration, flock sees Dataflow D1 first, and when setting the "Carried By" on the message, "Carries" is set on the message, hence why D1 appears first in the "Carries" list after running the migration.

Thanks for your help!
  • Attachment: reorder.zip
    (Size: 1.95KB, Downloaded 58 times)
Re: Flock reordering items when using opposite references in EMF [message #1847675 is a reply to message #1847670] Wed, 03 November 2021 12:23 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Justin,

Your assessment is correct. Unfortunately, EMC doesn't provide abstractions through which Flock can know about EMF-specific features such as opposite references, which it could check to avoid cases like this. A workaround would be to add an explicit migration rule for Message which contains an assignment statement for the carries property, that will be executed after the conservative copying algorithm and will ensure that the order of the dataflows is preserved i.e.

migrate Message {
  migrated.carries = original.carries.equivalent();
}


Thanks,
Dimitris
Re: Flock reordering items when using opposite references in EMF [message #1847676 is a reply to message #1847675] Wed, 03 November 2021 12:48 Go to previous message
Justin Cooper is currently offline Justin CooperFriend
Messages: 6
Registered: August 2019
Junior Member
Thanks Dimitris! I'll implement the workaround for the moment and will post any updates should I find an alternative solution.
Previous Topic:Ecore/EVL check component is instantiated
Next Topic:EGL undesirable trim on return template operations
Goto Forum:
  


Current Time: Fri Apr 26 20:40:31 GMT 2024

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

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

Back to the top