Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Transforming a model instance to .e4xmi and .fxml
Transforming a model instance to .e4xmi and .fxml [message #1748166] Sun, 20 November 2016 00:16 Go to next message
Henri Boucher is currently offline Henri BoucherFriend
Messages: 56
Registered: September 2015
Member
I'm looking at using ATL to generate an application.e4xmi file from a model instance but I can't find a corresponding .km3 or .ecore file. Where can I find it?

I also need to generate .fxml files which are plain javafx XML files, as opposed to XMI. What would work best for this transformation?

Any suggestions or guidance appreciated.
Re: Transforming a model instance to .e4xmi and .fxml [message #1748191 is a reply to message #1748166] Mon, 21 November 2016 06:43 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31900
Registered: July 2009
Senior Member
Of course each project that uses EMF to define models provides their own models and where those might be is determined by that project, so best you ask each project's forum about that.

One trick you might use is if you have any *.ecore open, you can use Load Resource... from the context menu and then use either Browser Target Platform Packages... (packages available in the target platform) or Browse Registered Packages... (packages registered in the running IDE/application) to locate packages of interest.

I don't know anything about javafx XML files. Perhaps https://www.eclipse.org/efxclipse/index.html provides something useful for this purpose.





Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Transforming a model instance to .e4xmi and .fxml [message #1748577 is a reply to message #1748191] Thu, 24 November 2016 16:39 Go to previous messageGo to next message
Henri Boucher is currently offline Henri BoucherFriend
Messages: 56
Registered: September 2015
Member
Ed, thanks for taking the time to respond.

A link to the .ecore files for .e4xmi can be found in this topic.

As for .fxml, a quick review of the M2T (model-to-text transformation) forum show Acceleo and Xpand are in use. Interestingly wiki.eclipse.org/Xpand -> Tutorial leads to www.eclipse.org/Xtext. Which would you recommend or are there any other M2T tools I should be considering?
Re: Transforming a model instance to .e4xmi and .fxml [message #1748598 is a reply to message #1748577] Fri, 25 November 2016 06:57 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 31900
Registered: July 2009
Senior Member
I would have expected an XML language to have an XML Schema, but I suppose that's not the case?

Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Transforming a model instance to .e4xmi and .fxml [message #1748688 is a reply to message #1748598] Sat, 26 November 2016 23:56 Go to previous messageGo to next message
Henri Boucher is currently offline Henri BoucherFriend
Messages: 56
Registered: September 2015
Member
Googling "javafx.ecore" just turns up my M2T topic. Interestingly I found an explanation here. Search for "There will"

Quote:
There will never be a full reference (nor xml schema) for FXML as it works by reflecting on Java classes in the classpath and defining elements and attributes based on the properties of the classes.


I've been posting here as well. Maybe Xpand or a M2T other than Acceleo would be better suited. Please let me know if you are aware any.

Cheers.
Re: Transforming a model instance to .e4xmi and .fxml [message #1748695 is a reply to message #1748688] Sun, 27 November 2016 09:26 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7162
Registered: July 2009
Senior Member
Hi

Then Modisco may be perfect since I think it can (easily be extended to) reflect on the classpath and produce an Ecore file.

Regards

Ed Willink
Re: Transforming a model instance to .e4xmi and .fxml [message #1748726 is a reply to message #1748695] Mon, 28 November 2016 00:23 Go to previous messageGo to next message
Henri Boucher is currently offline Henri BoucherFriend
Messages: 56
Registered: September 2015
Member
Hi Ed Willink,

I'm going to try and use Epsilon because I'm a little bit out of my depth with Modisco. However if that doesn't work out is there any chance you could produce the Ecore file?

Thanks Ed and Ed.
Re: Transforming a model instance to .e4xmi and .fxml [message #1748742 is a reply to message #1748726] Mon, 28 November 2016 09:23 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7162
Registered: July 2009
Senior Member
Hi

To be honest, if I was doing this myself, I would use Java to create the missing Ecore (instance) model since I already have a classpath scan that I am familiar with:

doFullScan() in /org.eclipse.ocl.xtext.oclstdlib/src/org/eclipse/ocl/xtext/oclstdlib/scoping/JavaClassScope.java

Then an M2M to transform the Ecore instance of the Ecore metamodel to the fxml instance of the XML metamodel.

The amount of detail that you require in your Ecore instance model is probably pretty limited, perhaps just EPackage, EClass, EAttribute, EReference; no EOperation, but perhaps you need EGenericType too. It's pretty simple, so faster to code it yourself than struggle to re-use an unfamiliar fuller capability. You could even make it adapt incrementally to classpath changes/rebuilds with moderate effort.

Regards

Ed Willink
Re: Transforming a model instance to .e4xmi and .fxml [message #1748904 is a reply to message #1748742] Wed, 30 November 2016 00:14 Go to previous messageGo to next message
Henri Boucher is currently offline Henri BoucherFriend
Messages: 56
Registered: September 2015
Member
Hi Ed

I haven't yet invested much time in learning Acceleo or epsilon. I accept that Acceleo would probably be easier to learn and use. If you get me the .ecore for javafx (or all of java) I'll give it a try on the weekend.

Best regards,
Henri
Re: Transforming a model instance to .e4xmi and .fxml [message #1748913 is a reply to message #1748904] Wed, 30 November 2016 06:01 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7162
Registered: July 2009
Senior Member
Hi

I am sorry. You seem to have completely misunderstood. If you want me to do your work for you, My company can send you an SOW.

Regards

Ed Willink
Previous Topic:XMI idref reading error
Next Topic:Control Flow Graph Meta-model
Goto Forum:
  


Current Time: Tue Jun 15 01:35:42 GMT 2021

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

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

Back to the top