Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Type in Ecore not found
Type in Ecore not found [message #1749231] Sat, 03 December 2016 18:47 Go to next message
John Dawes is currently offline John DawesFriend
Messages: 19
Registered: November 2016
Junior Member
Hi,

I have a couple of questions regarding the definition and registration of ecore models.

Q1. In the example metamodels, there exist two files for each type of metamodel. One with the '.emf' extension and the other one with the '.ecore' extension (i.e., Graph.emf and Graph.ecore). Seems like both of them are equivalent. I am wondering, for defining my own metamodel, will I also have to create both types of files? Or, creating just '.ecore' file is enough?

Q2. I created a simple ecore file by following the tutorial on http://eclipsesource.com/blogs/tutorials/emf-tutorial.

Please find the attached screenshot of the ecore file. I registered this file and also specify it in the list of metamodels for target specification while creating the '.launch' file. Unfortunately, after running the following ETL code, the console output says "Type B1 not found". What am I doing wrong here?

ETL Code:
         rule basic
		transform source:UML_Input!Model
		to target:B1{
			target.name=source.name;
		}
        
Re: Type in Ecore not found [message #1749247 is a reply to message #1749231] Sun, 04 December 2016 10:41 Go to previous messageGo to next message
Eclipse UserFriend
Q1. They are just two different ways of representation, one of which can be converted to the other one automatically.

Q2. B1 is not a kind of EClass, it is a package. I can guess that ETL rules are design to generate instances of EClasses. So your rule should be something like:

rule basic
	transform 
                source:UML_Input!Model
		       to 
                target:B1!C
{
        target.name=source.name;
}


assuming that your output model is named B1 and you are trying to create an instance of C.
Re: Type in Ecore not found [message #1749255 is a reply to message #1749247] Sun, 04 December 2016 15:25 Go to previous messageGo to next message
John Dawes is currently offline John DawesFriend
Messages: 19
Registered: November 2016
Junior Member
Hi Bugra,

Thanks for the response. I already tried using "B1!C" instead of "B1", but with no changes in the result. Console output for this one is "Type B1!C not found". Is there anything else that can possibly cause this problem?
Re: Type in Ecore not found [message #1749257 is a reply to message #1749255] Sun, 04 December 2016 16:19 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2162
Registered: July 2009
Location: York, UK
Senior Member

Hi,

As long as your model is named B1 in the model configuration dialog of your run configuration this should work fine. If it doesn't, could you please put together a minimal example [1] we can use to reproduce this?

Cheers,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/articles/minimal-examples/
Re: Type in Ecore not found [message #1749271 is a reply to message #1749257] Mon, 05 December 2016 04:51 Go to previous messageGo to next message
John Dawes is currently offline John DawesFriend
Messages: 19
Registered: November 2016
Junior Member
Dimitris Kolovos wrote on Sun, 04 December 2016 16:19
Hi,

As long as your model is named B1 in the model configuration dialog of your run configuration this should work fine. If it doesn't, could you please put together a minimal example [1] we can use to reproduce this?

Cheers,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/articles/minimal-examples/



Hi Dimitris,

Thanks for pointing out the problem. The model was not named B1 in the model configuration window previously and I think that's what caused the problem.

However, I am still having issue in launching this transformation Sad. Now, I am getting a Java runtime null-pointer exception. Please find attached screenshots. As you will see, for making it simple, I used the 'tree.model' from epsilon example directory as the input and B1.ecore as the metamodel of the output. Am I doing anything wrong?
Re: Type in Ecore not found [message #1749306 is a reply to message #1749271] Mon, 05 December 2016 09:54 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2162
Registered: July 2009
Location: York, UK
Senior Member

Hi John,

A minimal example [1] would help a lot.

Cheers,
Dimitris

[1] https://www.eclipse.org/epsilon/doc/articles/minimal-examples/
Re: Type in Ecore not found [message #1749339 is a reply to message #1749306] Mon, 05 December 2016 16:12 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2162
Registered: July 2009
Location: York, UK
Senior Member

Hi John,

It appears that the Name attribute of your Cla1 class is missing a type (the way I found out was by opening J1.ecore, right-clicking on the J1 EPackage and selecting "Validate"). Setting its type to EString seems to be doing the trick.

Cheers,
Dimitris
icon14.gif  Re: Type in Ecore not found [message #1749342 is a reply to message #1749339] Mon, 05 December 2016 17:01 Go to previous message
John Dawes is currently offline John DawesFriend
Messages: 19
Registered: November 2016
Junior Member
Dimitris Kolovos wrote on Mon, 05 December 2016 16:12
Hi John,

It appears that the Name attribute of your Cla1 class is missing a type (the way I found out was by opening J1.ecore, right-clicking on the J1 EPackage and selecting "Validate"). Setting its type to EString seems to be doing the trick.

Cheers,
Dimitris


Yes, it worked! Thank you very much.
Previous Topic:Epsilon Comparison language
Next Topic:Why node element changes when downloading from svn
Goto Forum:
  


Current Time: Tue Apr 16 13:51:24 GMT 2024

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

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

Back to the top