Flock reordering items when using opposite references in EMF [message #1847670] |
Wed, 03 November 2021 11:16 |
Justin Cooper 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 |
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03505 seconds