Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Element matching
Element matching [message #1834624] Fri, 13 November 2020 17:03 Go to next message
pere joseph rodríguez is currently offline pere joseph rodríguezFriend
Messages: 51
Registered: October 2014
Member
Hi,
is it possible to load the same model on two different resource sets and then find the same element from one resourceset in the second resourceset after the second resourceset has been transformed (such as moving packages)?

Thanks,
Pere Joseph Rodríguez

Re: Element matching [message #1834629 is a reply to message #1834624] Fri, 13 November 2020 18:54 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

Yes, but to some extent it depends what your transformation does.

If your transformation is EObject-preserving, just EReference/EAttribute changing then you can correlate refactoring via the Resource xmi:ids.

If your transformation creates new EObjects, it is generally a good idea to maintain a traceability map from old2new and/or new2old. Most transformation tools do this to solve the traceability problem that allows multiple mappings to share each other's contributions. EcoreUtil.Copier that can be overridden as a simple transformation framework also maintains a Map. Much much easier to retain the mapping as you go than to go to extravagant lengths to inaccurately rediscover what was carelessly discarded.

Regards

Ed Willink
Re: Element matching [message #1834854 is a reply to message #1834629] Thu, 19 November 2020 08:11 Go to previous message
pere joseph rodríguez is currently offline pere joseph rodríguezFriend
Messages: 51
Registered: October 2014
Member
Thanks Ed,
I was thinking different approaches to create model views, keeping references, and in the end think the best solution in my case will be to create a modelview profile to stereotype all elements pointing to their corresponding in the original model. This way I can also discard child elements in the tree.
Previous Topic:Parsing of xml with xs:any element with different namespaces
Next Topic:Feature IDs in generated code
Goto Forum:
  


Current Time: Sat Apr 27 01:37:17 GMT 2024

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

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

Back to the top