Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Error loading File
Error loading File [message #898523] Thu, 26 July 2012 10:13 Go to next message
Florian B. is currently offline Florian B.
Messages: 21
Registered: July 2012
Location: Hamburg Germany
Junior Member
Hello all,

I have a problem with ATL.

I want to transform an Ecore model instance to a standard xml model instance.

what I have done so far is, I created an Ecore model of my xml model via the XSD import wizard. I can read and write this xml instances without any problems.

Also the Ecore instances can be read without problems.

I now have the problem with ATL.

I've created a simple rule:

-- @path Fibex=/FibexECore/model/fbx.ecore
-- @path TTND=/TTENetworkDescriptionECore/model/Network_Configuration.ecore

module TteND2Fibex;
create OUT : Fibex from IN : TTND;

helper context TTND!DeviceReferringElement def: isSwitch(): Boolean =
	if self.refDeviceSpecification.toString().startsWith('ds:Switch') then
		true
	else
		false
	endif;
			

rule TTEDevices2FibexTopology {
	from 
		s: TTND!DeviceReferringElement ( not s.isSwitch())
	
	to
		t: Fibex!ECUTYPE (
			sHORTNAME <- s.name 
			)
}


But when I choose an instance of the network_configuration.ecore , I'm always getting the error: Error loading platform:/resource/TteND2Fibex/NC_Test.network_config: null
I have registered the metamodel via rightclick on the models.

The same file can be read and parsed without problem, if I do it in generated java sources example files from the emf.

Any help would be appreciated.
THX
Re: Error loading File [message #898685 is a reply to message #898523] Fri, 27 July 2012 04:14 Go to previous messageGo to next message
Florian B. is currently offline Florian B.
Messages: 21
Registered: July 2012
Location: Hamburg Germany
Junior Member
If I do not register the ecore models, I get the following error:
Error loading platform:/resource/TteND2Fibex/NC_Test.network_config: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http:// XXX/Network_Config_V1' not found. (platform:/resource/TteND2Fibex/NC_Test.network_config, 14, 70)

I guess this at least a speaking error. So I registered the ecore-model.

But the
Error loading platform:/resource/TteND2Fibex/NC_Test.network_config: null

when I registered the model is not so speaking...

Maybe it has something to do with dependencies inside the source and target models, 'cause I have a few more ecore descriptions inside the source and target model. But it changed nothing, when I register all my models....

Any ideas?

Thank you


Re: Error loading File [message #898781 is a reply to message #898685] Fri, 27 July 2012 10:22 Go to previous messageGo to next message
Florian B. is currently offline Florian B.
Messages: 21
Registered: July 2012
Location: Hamburg Germany
Junior Member
Is there any way to debug this behavior?
Re: Error loading File [message #898824 is a reply to message #898781] Fri, 27 July 2012 15:11 Go to previous messageGo to next message
Ronan B is currently offline Ronan B
Messages: 229
Registered: July 2009
Senior Member
Hi,
Are you generating the model code, and subsequently the meta-model registration code, using the .genmodel? If you generate the code and then install the code generated ATl will be able to read the meta-model. Also if you generate an editor off the .genmodel you can build a few test models to see how the XML/XMI should look.
Regards,
Ronan
Re: Error loading File [message #898866 is a reply to message #898824] Sat, 28 July 2012 08:20 Go to previous messageGo to next message
Florian B. is currently offline Florian B.
Messages: 21
Registered: July 2012
Location: Hamburg Germany
Junior Member
Hi Ronan,

thanks for the reply. Yes, i generated code via the .genmodel. I generated all code options. Also the ecore model instance seems to be valid, because I used the test code examples from the generated code to read the XML files.
I guess I did not perform the meta-model registration. I just registered the ecore models via right click. What is the difference??

What do you mean with
Quote:
If you generate the code and then install the code generated ATl will be able to read the meta-model.
?

Thank you very much.
Re: Error loading File [message #899109 is a reply to message #898866] Mon, 30 July 2012 11:11 Go to previous messageGo to next message
Ronan B is currently offline Ronan B
Messages: 229
Registered: July 2009
Senior Member
Hi,
I normally run 2 sessions of eclipse when running ATL. The second session has the plugins installed and allows for easier debugging. Of course you can also register the models as you do in the same eclipse.

If your meta-model has any errors in it it will not deploy correctly. It sounds like there is an error there.

Regards,
Ronan
Re: Error loading File [message #899280 is a reply to message #899109] Tue, 31 July 2012 06:25 Go to previous message
Florian B. is currently offline Florian B.
Messages: 21
Registered: July 2012
Location: Hamburg Germany
Junior Member
Hi Ronan,

is there a way to find out the error of the meta-model? I mean the weird thing is, the generated code seems to work, while parsing the instance...

Previous Topic:UML2 to Java Literals
Next Topic:Getting the current rule's name
Goto Forum:
  


Current Time: Thu Apr 17 23:44:58 EDT 2014

Powered by FUDForum. Page generated in 0.03020 seconds