Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Loading a model by its URI programmatically
[ATL] Loading a model by its URI programmatically [message #104985] Thu, 14 May 2009 18:14 Go to next message
kaab  is currently offline kaab Friend
Messages: 43
Registered: July 2009
Member
Hi,

I'm trying to load an ecore which is already in the resigtry using its
URI. This an effort to upgrade a loader from code to the new version of
the API. The code does not cause any error but does not go trough the
transformation, I think that the models are not well loaded here so I
would like to know if there's a problem with the snippet I am using :

static AtlEMFModelHandler aemfh =
(AtlEMFModelHandler)AtlModelHandler.getDefault(AtlModelHandl er.AMH_EMF);
final EMFModelLoader modelLoader =
(EMFModelLoader)aemfh.createModelLoader();
inputMetaModel = (ASMEMFModel)modelLoader.loadModel("kdm",
modelLoader.getMOF(), "uri:" + CodePackage.eNS_URI);

I have had a look to the new API by following the examples provided, it
works fine when loading the ecore from the file, things seem different
when trying to use the registry.

Thanks,
Re: [ATL] Loading a model by its URI programmatically [message #104993 is a reply to message #104985] Thu, 14 May 2009 21:24 Go to previous message
kaab  is currently offline kaab Friend
Messages: 43
Registered: July 2009
Member
Sorry in my last post I was using old API functions with the new plugin,
this might be the cause the problem.
I am now able to run the transformation from code but it still have an
error when it comes to loading multi package ecore. It seems to load only
an EPackage leaving all the other.

Is this a bug in the new API ? Or am I using it wrong, as for the last
version I load one of the EPackages and expect ATL to load all the other
corresponding ones. Here's the code used to achieve model injection :

ModelFactory factory = CoreService.createModelFactory("EMF");
kdmMetaModel = factory.newReferenceModel();
injector.inject(kdmMetaModel, DataPackage.eNS_URI.toString(),options);

The problem remains when trying to load using atl launch configuration.

Thanks for your help.
Previous Topic:Match rule (assigning the default target element of another rule)
Next Topic:[ATL] An error about calling a rule.
Goto Forum:
  


Current Time: Thu Apr 25 01:59:12 GMT 2024

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

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

Back to the top