Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Getting imported packages of a model
[ATL] Getting imported packages of a model [message #92538] Wed, 15 October 2008 09:31 Go to next message
Eclipse UserFriend
Originally posted by: rivera.lcc.uma.es

Hi all,

is it possible to get from ATL (at leat the uri of) all imported
packages of a model? When a model has cross references it may include
several packages (e.g.:uml, MagicDrawProfile...):

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.1" mlns:xmi="http://schema.omg.org/spec/XMI/2.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:MagicDrawProfile="http:///schemas/MagicDrawProfile/_OFOuUIP0Ed22b8pqYqrhHA/0"
xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"... >
<uml:Model xmi:id="eee_1045467100313_135436_1" name="Data">

Is it possible to obtain them? I know I get them through the metaclass
of every object ((EObject).eClass().ePackage) but this forces every
element to be navigated to obtain all imported packages, ¿is there any
other (more efficient) way?

Thank you in advance,
Eduardo
Re: [ATL] Getting imported packages of a model [message #93219 is a reply to message #92538] Fri, 24 October 2008 07:40 Go to previous messageGo to next message
Max Bureck is currently offline Max BureckFriend
Messages: 72
Registered: July 2009
Member
Hello,

I don't know if this is exactly what you need, but you can access all
imported packages of a UML2 model and it's sub-elements like this:

UML2!"uml::Namespace".allInstancesFrom('IN')->collect(n|n.getImportedPackages())- >flatten().asSet()

where "IN" is the name of the input UML2 model.

Greetings,
Max
Re: [ATL] Getting imported packages of a model [message #95777 is a reply to message #93219] Thu, 20 November 2008 12:08 Go to previous message
Eclipse UserFriend
Originally posted by: rivera.lcc.uma.es

Hi Max,

thank you for your response, but actually I dont refer to Package as
metamodelo elements (as in UML), but packages imported in eclipse models
in the header.

Regards,
Edu

Max Bureck escribió:
> Hello,
>
> I don't know if this is exactly what you need, but you can access all
> imported packages of a UML2 model and it's sub-elements like this:
>
> UML2!"uml::Namespace".allInstancesFrom('IN')->collect(n|n.getImportedPackages())- >flatten().asSet()
>
>
> where "IN" is the name of the input UML2 model.
>
> Greetings,
> Max
>
Previous Topic:No generation with Unique Lazy rule calling itself
Next Topic:[QVTO] Unspecified upper bound (-2)
Goto Forum:
  


Current Time: Fri Apr 26 04:38:55 GMT 2024

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

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

Back to the top