Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » ETL Transformations: Types Not Found(When perfoming transformations on UML Sequence Diagrams, the program does not recognize the types present in the UML metamodel)
ETL Transformations: Types Not Found [message #1847108] Thu, 14 October 2021 22:33 Go to next message
Miguel Fernandes is currently offline Miguel FernandesFriend
Messages: 7
Registered: July 2021
Junior Member
Hello!

I'm trying to transform Sequence Diagrams (UML models) into another kind of model (a xmi representation of Colored Petri Nets) using ETL, from a Java application (via the org.eclipse.epsilon libraries)

I have this problem when trying to transform the models using ETL, where the object types (e.g. uml!Lifeline or cpn!Place) are not recognized, as in "type ... not found". I have the ecore metamodel for both UML and the CPNs.

This happens, I would say, because the program, when running the ETL file, does not find the metamodel or does not access it correctly. But I cannot figure out why.

This is how I load the models:

EmfModel modelcpn = new EmfModel();
modelcpn.setModelFile("src/cpnModel.model");
modelcpn.setMetamodelFile("src/cpnmeta.ecore");
modelcpn.load();


I have tried to create a minimal example, which I have attached to this post, and which also includes the libraries that I'm using.

Thank you in advance for your help
Best regards

Miguel
  • Attachment: MinEx.zip
    (Size: 6.29MB, Downloaded 90 times)
Re: ETL Transformations: Types Not Found [message #1847109 is a reply to message #1847108] Thu, 14 October 2021 22:42 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

Hi Miguel,

You need to give your models the names you use to refer to them in your transformation i.e.

modelcpn.setName("cpnmeta");
...
modeluml.setName("uml");


Best,
Dimitris
Re: ETL Transformations: Types Not Found [message #1847111 is a reply to message #1847109] Thu, 14 October 2021 23:24 Go to previous messageGo to next message
Miguel Fernandes is currently offline Miguel FernandesFriend
Messages: 7
Registered: July 2021
Junior Member
It solved the problem!

Thank you very much
Re: ETL Transformations: Types Not Found [message #1847112 is a reply to message #1847111] Thu, 14 October 2021 23:26 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

I'm glad to hear that - you're welcome!
Re: ETL Transformations: Types Not Found [message #1847188 is a reply to message #1847112] Mon, 18 October 2021 16:33 Go to previous messageGo to next message
Miguel Fernandes is currently offline Miguel FernandesFriend
Messages: 7
Registered: July 2021
Junior Member
Hello (again) Dimitris!

With the solution you promptly provided, I managed to finally test my ETL, which (as I expected) had some mistakes, as well as things missing.

I managed to remove these problems from the ETL code, but still my output model (.model) turns out to be empty. This is strange because when I print the variables that I create in my target model (from the ETL code), the target model elements seem to be there.

I attached a revised version of the Minimal Example I previously sent, which also includes in the code some prints to the console, in order to show that the model elements are actually being created in the ETL code.

I was hoping you could help me with this issue.
Again, I thank you for your help and availability.
Best regards.

Miguel
  • Attachment: MinEx.zip
    (Size: 6.29MB, Downloaded 99 times)
Re: ETL Transformations: Types Not Found [message #1847201 is a reply to message #1847188] Tue, 19 October 2021 09:09 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2165
Registered: July 2009
Location: York, UK
Senior Member

Hi Miguel,

You should configure cpnmodel so that its existing contents are discarded and it is stored when the transformation is complete as follows.

modelcpn.setReadOnLoad(false);
modelcpn.setStoredOnDisposal(true);


Also, after module2.execute() you should call modelcpn.dispose() to save the model (or module2.getContext().getModelRepository().dispose() to dispose/save any models that are configured to be saved).

I've also updated https://www.eclipse.org/epsilon/doc/articles/run-epsilon-from-java/#loading-models accordingly for the benefit of other users in the future.

Thanks,
Dimitris

[Updated on: Tue, 19 October 2021 10:11]

Report message to a moderator

Re: ETL Transformations: Types Not Found [message #1847220 is a reply to message #1847201] Tue, 19 October 2021 16:06 Go to previous message
Miguel Fernandes is currently offline Miguel FernandesFriend
Messages: 7
Registered: July 2021
Junior Member
Hello Dimitris,

It did the trick!
The .model xmi CPN was generated!

Thank you very much for all the help!
Best regards.

Miguel
Previous Topic:Xtext Graphical View
Next Topic:Ecore/EVL check component is instantiated
Goto Forum:
  


Current Time: Sat Apr 27 09:27:03 GMT 2024

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

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

Back to the top