Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Unable to update the URI fragment of proxy element on Edapt Migration(Unable to update the URI fragment of proxy element on Edapt Migration)
Unable to update the URI fragment of proxy element on Edapt Migration [message #1803350] Wed, 27 February 2019 09:41 Go to next message
Arun Kumar is currently offline Arun KumarFriend
Messages: 14
Registered: January 2016
Junior Member
I got stuck on updating the proxy URI of reference element and I have not much experienced in creating custom edapt migration , Below is my scenario

I have " ParentClassA " which has ereference to " RefClassB". Attribute "linkID" is been used to Identify this object.

" linkID " will be calculated based on few factor/other attriubtes in RefClassB and its eContainter.

Now, I have changed the way "linkID" is being calculated. I want to make an edapt migration to support this.

I tried below code,

for (Instance parameterInstance : model.getAllInstances("ParentClassA ")) {			Instance identifierInstance = parameterInstance.getLink("RefClassB");
identifierInstance.getUri().appendFragment(getLatestURI);
}


getLatestURI is again based on the attributes on "RefClassB", Since ,being proxy element, I am unable to get req.details from identifierInstance .

Is there any edapt operation to support the change of URI proxy value? I tried few custom migration, nothing got worked. Please someone help me on this,

NOTE: ParentClassA will be on one file and RefClassB on another file.

Re: Unable to update the URI fragment of proxy element on Edapt Migration [message #1803434 is a reply to message #1803350] Thu, 28 February 2019 15:59 Go to previous messageGo to next message
Johannes Faltermeier is currently offline Johannes FaltermeierFriend
Messages: 101
Registered: December 2013
Senior Member

Hi,

You can change the URI like this:
final Instance refClassB = ...;
refClassB.getResource().setUri(URI.createFileURI("/new/path/name.xmi"));


Was this the only thing you were missing?
I think you have access to all ParentClassAs and can get the RefClassBs from them, so you should have everything to determine the linkID and the new URI

Cheers
Johannes


Johannes Faltermeier

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Re: Unable to update the URI fragment of proxy element on Edapt Migration [message #1803463 is a reply to message #1803434] Fri, 01 March 2019 06:40 Go to previous messageGo to next message
Arun Kumar is currently offline Arun KumarFriend
Messages: 14
Registered: January 2016
Junior Member
Johannes,

Problem is "refClassB " will be available in different file and that file is not been migrated along with current file migration.
Content in file 1:
<ParentClassA  name="test" ...... >
<RefClassB href="file2.xml/ABC-DEF" />
</ParentClassA >

I am trying to migrate something like,
<ParentClassA  name="test" ...... >
<RefClassB href="file2.xml/QWER-XYZ" />
</ParentClassA >


I was able to do this, when all the contents are present in same file via custom migration , but my scenario is that I splitted the content in different file and try to make migration one file by another.

Also, I am not sure how to make whole project to get migrated..

Thanks in advance !


Re: Unable to update the URI fragment of proxy element on Edapt Migration [message #1803600 is a reply to message #1803463] Tue, 05 March 2019 09:30 Go to previous message
Johannes Faltermeier is currently offline Johannes FaltermeierFriend
Messages: 101
Registered: December 2013
Senior Member

Hi,
I quickly tested spiting the model to different files and it worked for me.
Are you using some custom URIConverters or something like that? Could you maybe provide a reproducible example so that I may debug it?
Cheers
Johannes


Johannes Faltermeier

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Previous Topic:Edapt doesn't do specialize reference type while ecore migration changes
Next Topic:EMF Neon problem
Goto Forum:
  


Current Time: Thu Apr 25 18:51:41 GMT 2024

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

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

Back to the top