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.
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.
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....
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
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.
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.