Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] How to use UML with profile as input to a transformation
[ATL] How to use UML with profile as input to a transformation [message #86114] Tue, 08 July 2008 13:16 Go to next message
Eclipse UserFriend
Originally posted by: martifag.abc.efg

Hi!

I have a UML-model with an applied profile.

These were both made with Papyrus UML.

I am using the profile as the metamodel of the input uml model. Is this
the correct way to do things? It works, but strikes me as a bad solution
as I would not be able to apply more profiles.

So, questions:

- What is the correct way to configure a uml with applied profiles as
input?
- How does ATL handle the namespaces and different versions of the
profile which is defined? i.e. if I use the filename of the profile as
input, how does ATL know which version? (I solved this by only having
one defined profile inside the profile.uml file. But I dont know why.).

Thanks!
- Martin

ps.
- I would like to se multiline comments and "empty commas" so that I
can end each statement with a comma (this helps debugging) in ATL.
Re: [ATL] How to use UML with profile as input to a transformation [message #86159 is a reply to message #86114] Wed, 09 July 2008 08:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ebadgley.mitre.org

No input here (sorry, Martin) but I wanted to chime in, as I'm doing
something almost identical to what you are. I too am using the .profile.uml
as the metamodel (with "UML2" as the handler).

I do have multiple profile definitions in my profile .uml file, but I
altered the "old" definitions to provide a suffix to the name (so, for
example, if my profile is "NASProfile", I renamed the older version to
"NASProfile_0").

I'm basing my code/ATL files off of the
UML2Copy/UML2Profiles/UML2ProfileCopy.atl examples from the excellent SSEL
MDE Case Studies (http://ssel.vub.ac.be/ssel/research:mdd:casestudies). In
those examples, they are using an .ecore for the metamodel that imports the
stereotype definitions, etc. from *all* of the profiles they might need to
use. I started out following this lead but was having problems getting it
to work correctly.

- Ellen Badgley


"Martin Johansen" <martifag@abc.efg> wrote in message
news:g4vpcq$a25$4@build.eclipse.org...
> Hi!
>
> I have a UML-model with an applied profile.
>
> These were both made with Papyrus UML.
>
> I am using the profile as the metamodel of the input uml model. Is this
> the correct way to do things? It works, but strikes me as a bad solution
> as I would not be able to apply more profiles.
>
> So, questions:
>
> - What is the correct way to configure a uml with applied profiles as
> input?
> - How does ATL handle the namespaces and different versions of the
> profile which is defined? i.e. if I use the filename of the profile as
> input, how does ATL know which version? (I solved this by only having one
> defined profile inside the profile.uml file. But I dont know why.).
>
> Thanks!
> - Martin
>
> ps.
> - I would like to se multiline comments and "empty commas" so that I can
> end each statement with a comma (this helps debugging) in ATL.
Re: [ATL] How to use UML with profile as input to a transformation [message #89305 is a reply to message #86159] Fri, 29 August 2008 08:18 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 147
Registered: July 2009
Senior Member
Hello Martin, Ellen,

Stereotypes/profiles really don't play nice with model transformation
languages in general. It is likely that there will always be some
hacking involved. Some comments below:

Ellen Badgley wrote:
> No input here (sorry, Martin) but I wanted to chime in, as I'm doing
> something almost identical to what you are. I too am using the .profile.uml
> as the metamodel (with "UML2" as the handler).
>
> I do have multiple profile definitions in my profile .uml file, but I
> altered the "old" definitions to provide a suffix to the name (so, for
> example, if my profile is "NASProfile", I renamed the older version to
> "NASProfile_0").

This is indeed necessary for ATL to uniquely pin down the EPackage that
contains the latest version of the profile. I always delete the
EPackages of the older profile versions before transformation, as there
are no "old" models around in my case.

>
> I'm basing my code/ATL files off of the
> UML2Copy/UML2Profiles/UML2ProfileCopy.atl examples from the excellent SSEL
> MDE Case Studies (http://ssel.vub.ac.be/ssel/research:mdd:casestudies). In
> those examples, they are using an .ecore for the metamodel that imports the
> stereotype definitions, etc. from *all* of the profiles they might need to
> use. I started out following this lead but was having problems getting it
> to work correctly.

When you follow this approach, you have to make sure you've (re-)applied
your profile to ensure that the latest version is used. Then, your
"proxy" meta-model that contains references to all necessary meta-models
including profiles, should also use references to the latest version of
your profile's meta-classes (one referenced meta-class is enough for ATL
to find the contents of the whole profile).

>
> - Ellen Badgley
>
>
> "Martin Johansen" <martifag@abc.efg> wrote in message
> news:g4vpcq$a25$4@build.eclipse.org...
>> Hi!
>>
>> I have a UML-model with an applied profile.
>>
>> These were both made with Papyrus UML.
>>
>> I am using the profile as the metamodel of the input uml model. Is this
>> the correct way to do things? It works, but strikes me as a bad solution
>> as I would not be able to apply more profiles.
>>
>> So, questions:
>>
>> - What is the correct way to configure a uml with applied profiles as
>> input?
>> - How does ATL handle the namespaces and different versions of the
>> profile which is defined? i.e. if I use the filename of the profile as
>> input, how does ATL know which version? (I solved this by only having one
>> defined profile inside the profile.uml file. But I dont know why.).

ATL doesn't know. ATL doesn't interpret the UML-specific
ProfileApplication elements that say which profile version was applied.
You can either do what Ellen did and rename your old profile versions,
or you just delete the old profile versions (after you've re-applied the
profile to your models).

>>
>> Thanks!
>> - Martin
>>
>> ps.
>> - I would like to se multiline comments and "empty commas" so that I can
>> end each statement with a comma (this helps debugging) in ATL.
>
>

You can put that in the bugzilla as a feature request, so we have a
tracker for it.

Regards,
Dennis
Re: [ATL] How to use UML with profile as input to a transformation [message #89411 is a reply to message #89305] Sat, 30 August 2008 10:59 Go to previous messageGo to next message
Eclipse UserFriend
Hi Dennis,

Just one question regarding your ATL command-line interface and
profiles/Stereotypes :

Is it possible to do apply Profile/Stereotype with your command-line
interface and if so how to set the parameters correctly ?

I tried the following parameters :

--trans "file:c:/eclipse/workspace/ATLPro/WithStereo.asm" --in
IN="Class1.uml" PRO="Test.profile.uml"
UML2="http://www.eclipse.org/uml2/2.1.0/UML" EMF --out
OUT="AppliedProfile.uml" UML2="http://www.eclipse.org/uml2/2.1.0/UML" EMF

Unfortunately, I get the following message on the console:

--trans file:C:/eclipse/workspace/ATLPro/WithStereo.asm --in
IN=Class1.uml PRO=Test.profile.uml
UML2=http://www.eclipse.org/uml2/2.1.0/UML
Input metamodel PRO @
org.eclipse.m2m.atl.engine.AtlEMFModelHandler@71dc3d not yet loaded -
loading from Test.profile.uml
Referenced extents:

Using input metamodel PRO : MOF
Loading input model IN from Class1.uml
Referenced extents: []
Using input model IN : PRO
Usage: <this program> --trans <transformation url> [--lib <id>=<library url>] [--superimpose <transformation url>

Regards,

Deepak


Dennis Wagelaar schrieb:
> Hello Martin, Ellen,
>
> Stereotypes/profiles really don't play nice with model transformation
> languages in general. It is likely that there will always be some
> hacking involved. Some comments below:
>
> Ellen Badgley wrote:
>> No input here (sorry, Martin) but I wanted to chime in, as I'm doing
>> something almost identical to what you are. I too am using the
>> .profile.uml as the metamodel (with "UML2" as the handler).
>>
>> I do have multiple profile definitions in my profile .uml file, but I
>> altered the "old" definitions to provide a suffix to the name (so, for
>> example, if my profile is "NASProfile", I renamed the older version to
>> "NASProfile_0").
>
> This is indeed necessary for ATL to uniquely pin down the EPackage that
> contains the latest version of the profile. I always delete the
> EPackages of the older profile versions before transformation, as there
> are no "old" models around in my case.
>
>>
>> I'm basing my code/ATL files off of the
>> UML2Copy/UML2Profiles/UML2ProfileCopy.atl examples from the excellent
>> SSEL MDE Case Studies
>> (http://ssel.vub.ac.be/ssel/research:mdd:casestudies). In those
>> examples, they are using an .ecore for the metamodel that imports the
>> stereotype definitions, etc. from *all* of the profiles they might
>> need to use. I started out following this lead but was having
>> problems getting it to work correctly.
>
> When you follow this approach, you have to make sure you've (re-)applied
> your profile to ensure that the latest version is used. Then, your
> "proxy" meta-model that contains references to all necessary meta-models
> including profiles, should also use references to the latest version of
> your profile's meta-classes (one referenced meta-class is enough for ATL
> to find the contents of the whole profile).
>
>>
>> - Ellen Badgley
>>
>>
>> "Martin Johansen" <martifag@abc.efg> wrote in message
>> news:g4vpcq$a25$4@build.eclipse.org...
>>> Hi!
>>>
>>> I have a UML-model with an applied profile.
>>>
>>> These were both made with Papyrus UML.
>>>
>>> I am using the profile as the metamodel of the input uml model. Is
>>> this the correct way to do things? It works, but strikes me as a bad
>>> solution as I would not be able to apply more profiles.
>>>
>>> So, questions:
>>>
>>> - What is the correct way to configure a uml with applied profiles
>>> as input?
>>> - How does ATL handle the namespaces and different versions of the
>>> profile which is defined? i.e. if I use the filename of the profile
>>> as input, how does ATL know which version? (I solved this by only
>>> having one defined profile inside the profile.uml file. But I dont
>>> know why.).
>
> ATL doesn't know. ATL doesn't interpret the UML-specific
> ProfileApplication elements that say which profile version was applied.
> You can either do what Ellen did and rename your old profile versions,
> or you just delete the old profile versions (after you've re-applied the
> profile to your models).
>
>>>
>>> Thanks!
>>> - Martin
>>>
>>> ps.
>>> - I would like to se multiline comments and "empty commas" so that I
>>> can end each statement with a comma (this helps debugging) in ATL.
>>
>>
>
> You can put that in the bugzilla as a feature request, so we have a
> tracker for it.
>
> Regards,
> Dennis
Re: [ATL] How to use UML with profile as input to a transformation [message #90126 is a reply to message #89411] Wed, 17 September 2008 12:38 Go to previous messageGo to next message
Dennis Wagelaar is currently offline Dennis WagelaarFriend
Messages: 147
Registered: July 2009
Senior Member
Deepak wrote:
> Hi Dennis,
>
> Just one question regarding your ATL command-line interface and
> profiles/Stereotypes :
>
> Is it possible to do apply Profile/Stereotype with your command-line
> interface and if so how to set the parameters correctly ?

I've never managed this. It's *really* hard to do any UML2 stuff outside
Eclipse, because of all the platform:/... URL resolving. I've only used
the command line interface for UML 1.4.

>
> I tried the following parameters :
>
> --trans "file:c:/eclipse/workspace/ATLPro/WithStereo.asm" --in
> IN="Class1.uml" PRO="Test.profile.uml"
> UML2="http://www.eclipse.org/uml2/2.1.0/UML" EMF --out
> OUT="AppliedProfile.uml" UML2="http://www.eclipse.org/uml2/2.1.0/UML" EMF

That's not the correct invocation syntax. You can only specify one
model/metamodel combination at a time with "--in".

>
> Unfortunately, I get the following message on the console:
>
> --trans file:C:/eclipse/workspace/ATLPro/WithStereo.asm --in
> IN=Class1.uml PRO=Test.profile.uml
> UML2=http://www.eclipse.org/uml2/2.1.0/UML
> Input metamodel PRO @
> org.eclipse.m2m.atl.engine.AtlEMFModelHandler@71dc3d not yet loaded -
> loading from Test.profile.uml
> Referenced extents:
>
> Using input metamodel PRO : MOF
> Loading input model IN from Class1.uml
> Referenced extents: []
> Using input model IN : PRO
> Usage: <this program> --trans <transformation url> [--lib <id>=<library url>] [--superimpose <transformation url>
>
> Regards,
>
> Deepak
>
>
> Dennis Wagelaar schrieb:
>> Hello Martin, Ellen,
>>
>> Stereotypes/profiles really don't play nice with model transformation
>> languages in general. It is likely that there will always be some
>> hacking involved. Some comments below:
>>
>> Ellen Badgley wrote:
>>> No input here (sorry, Martin) but I wanted to chime in, as I'm doing
>>> something almost identical to what you are. I too am using the
>>> .profile.uml as the metamodel (with "UML2" as the handler).
>>>
>>> I do have multiple profile definitions in my profile .uml file, but I
>>> altered the "old" definitions to provide a suffix to the name (so,
>>> for example, if my profile is "NASProfile", I renamed the older
>>> version to "NASProfile_0").
>>
>> This is indeed necessary for ATL to uniquely pin down the EPackage
>> that contains the latest version of the profile. I always delete the
>> EPackages of the older profile versions before transformation, as
>> there are no "old" models around in my case.
>>
>>>
>>> I'm basing my code/ATL files off of the
>>> UML2Copy/UML2Profiles/UML2ProfileCopy.atl examples from the excellent
>>> SSEL MDE Case Studies
>>> (http://ssel.vub.ac.be/ssel/research:mdd:casestudies). In those
>>> examples, they are using an .ecore for the metamodel that imports the
>>> stereotype definitions, etc. from *all* of the profiles they might
>>> need to use. I started out following this lead but was having
>>> problems getting it to work correctly.
>>
>> When you follow this approach, you have to make sure you've
>> (re-)applied your profile to ensure that the latest version is used.
>> Then, your "proxy" meta-model that contains references to all
>> necessary meta-models including profiles, should also use references
>> to the latest version of your profile's meta-classes (one referenced
>> meta-class is enough for ATL to find the contents of the whole profile).
>>
>>>
>>> - Ellen Badgley
>>>
>>>
>>> "Martin Johansen" <martifag@abc.efg> wrote in message
>>> news:g4vpcq$a25$4@build.eclipse.org...
>>>> Hi!
>>>>
>>>> I have a UML-model with an applied profile.
>>>>
>>>> These were both made with Papyrus UML.
>>>>
>>>> I am using the profile as the metamodel of the input uml model. Is
>>>> this the correct way to do things? It works, but strikes me as a bad
>>>> solution as I would not be able to apply more profiles.
>>>>
>>>> So, questions:
>>>>
>>>> - What is the correct way to configure a uml with applied profiles
>>>> as input?
>>>> - How does ATL handle the namespaces and different versions of the
>>>> profile which is defined? i.e. if I use the filename of the profile
>>>> as input, how does ATL know which version? (I solved this by only
>>>> having one defined profile inside the profile.uml file. But I dont
>>>> know why.).
>>
>> ATL doesn't know. ATL doesn't interpret the UML-specific
>> ProfileApplication elements that say which profile version was
>> applied. You can either do what Ellen did and rename your old profile
>> versions, or you just delete the old profile versions (after you've
>> re-applied the profile to your models).
>>
>>>>
>>>> Thanks!
>>>> - Martin
>>>>
>>>> ps.
>>>> - I would like to se multiline comments and "empty commas" so that
>>>> I can end each statement with a comma (this helps debugging) in ATL.
>>>
>>>
>>
>> You can put that in the bugzilla as a feature request, so we have a
>> tracker for it.
>>
>> Regards,
>> Dennis
Re: [ATL] How to use UML with profile as input to a transformation [message #90172 is a reply to message #90126] Thu, 18 September 2008 09:00 Go to previous message
Eclipse UserFriend
Hi Dennis,

Thanks, anyway!

However, can you or someone else out there put a small tutorial (**with
Java code snippets**) about "how to apply Profiles/Stereotypes with ATL
programmatically" in the Eclipse ATL Wiki ?

I think I am not the only one struggling with ATL when invoking
applypPofiles/applyStereotyes programmatically.


Thanks anyway.

Deepak





Dennis Wagelaar schrieb:
> Deepak wrote:
>> Hi Dennis,
>>
>> Just one question regarding your ATL command-line interface and
>> profiles/Stereotypes :
>>
>> Is it possible to do apply Profile/Stereotype with your command-line
>> interface and if so how to set the parameters correctly ?
>
> I've never managed this. It's *really* hard to do any UML2 stuff outside
> Eclipse, because of all the platform:/... URL resolving. I've only used
> the command line interface for UML 1.4.
>
>>
>> I tried the following parameters :
>>
>> --trans "file:c:/eclipse/workspace/ATLPro/WithStereo.asm" --in
>> IN="Class1.uml" PRO="Test.profile.uml"
>> UML2="http://www.eclipse.org/uml2/2.1.0/UML" EMF --out
>> OUT="AppliedProfile.uml" UML2="http://www.eclipse.org/uml2/2.1.0/UML" EMF
>
> That's not the correct invocation syntax. You can only specify one
> model/metamodel combination at a time with "--in".
>
>>
>> Unfortunately, I get the following message on the console:
>>
>> --trans file:C:/eclipse/workspace/ATLPro/WithStereo.asm --in
>> IN=Class1.uml PRO=Test.profile.uml
>> UML2=http://www.eclipse.org/uml2/2.1.0/UML
>> Input metamodel PRO @
>> org.eclipse.m2m.atl.engine.AtlEMFModelHandler@71dc3d not yet loaded -
>> loading from Test.profile.uml
>> Referenced extents:
>>
>> Using input metamodel PRO : MOF
>> Loading input model IN from Class1.uml
>> Referenced extents: []
>> Using input model IN : PRO
>> Usage: <this program> --trans <transformation url> [--lib <id>=<library url>] [--superimpose <transformation url>
>>
>> Regards,
>>
>> Deepak
>>
>>
>> Dennis Wagelaar schrieb:
>>> Hello Martin, Ellen,
>>>
>>> Stereotypes/profiles really don't play nice with model transformation
>>> languages in general. It is likely that there will always be some
>>> hacking involved. Some comments below:
>>>
>>> Ellen Badgley wrote:
>>>> No input here (sorry, Martin) but I wanted to chime in, as I'm doing
>>>> something almost identical to what you are. I too am using the
>>>> .profile.uml as the metamodel (with "UML2" as the handler).
>>>>
>>>> I do have multiple profile definitions in my profile .uml file, but
>>>> I altered the "old" definitions to provide a suffix to the name (so,
>>>> for example, if my profile is "NASProfile", I renamed the older
>>>> version to "NASProfile_0").
>>>
>>> This is indeed necessary for ATL to uniquely pin down the EPackage
>>> that contains the latest version of the profile. I always delete the
>>> EPackages of the older profile versions before transformation, as
>>> there are no "old" models around in my case.
>>>
>>>>
>>>> I'm basing my code/ATL files off of the
>>>> UML2Copy/UML2Profiles/UML2ProfileCopy.atl examples from the
>>>> excellent SSEL MDE Case Studies
>>>> (http://ssel.vub.ac.be/ssel/research:mdd:casestudies). In those
>>>> examples, they are using an .ecore for the metamodel that imports
>>>> the stereotype definitions, etc. from *all* of the profiles they
>>>> might need to use. I started out following this lead but was having
>>>> problems getting it to work correctly.
>>>
>>> When you follow this approach, you have to make sure you've
>>> (re-)applied your profile to ensure that the latest version is used.
>>> Then, your "proxy" meta-model that contains references to all
>>> necessary meta-models including profiles, should also use references
>>> to the latest version of your profile's meta-classes (one referenced
>>> meta-class is enough for ATL to find the contents of the whole profile).
>>>
>>>>
>>>> - Ellen Badgley
>>>>
>>>>
>>>> "Martin Johansen" <martifag@abc.efg> wrote in message
>>>> news:g4vpcq$a25$4@build.eclipse.org...
>>>>> Hi!
>>>>>
>>>>> I have a UML-model with an applied profile.
>>>>>
>>>>> These were both made with Papyrus UML.
>>>>>
>>>>> I am using the profile as the metamodel of the input uml model. Is
>>>>> this the correct way to do things? It works, but strikes me as a
>>>>> bad solution as I would not be able to apply more profiles.
>>>>>
>>>>> So, questions:
>>>>>
>>>>> - What is the correct way to configure a uml with applied profiles
>>>>> as input?
>>>>> - How does ATL handle the namespaces and different versions of the
>>>>> profile which is defined? i.e. if I use the filename of the profile
>>>>> as input, how does ATL know which version? (I solved this by only
>>>>> having one defined profile inside the profile.uml file. But I dont
>>>>> know why.).
>>>
>>> ATL doesn't know. ATL doesn't interpret the UML-specific
>>> ProfileApplication elements that say which profile version was
>>> applied. You can either do what Ellen did and rename your old profile
>>> versions, or you just delete the old profile versions (after you've
>>> re-applied the profile to your models).
>>>
>>>>>
>>>>> Thanks!
>>>>> - Martin
>>>>>
>>>>> ps.
>>>>> - I would like to se multiline comments and "empty commas" so that
>>>>> I can end each statement with a comma (this helps debugging) in ATL.
>>>>
>>>>
>>>
>>> You can put that in the bugzilla as a feature request, so we have a
>>> tracker for it.
>>>
>>> Regards,
>>> Dennis
Previous Topic:Loading ATL programmatically. PackageNotFoundException
Next Topic:Re: Model instance transformation framework
Goto Forum:
  


Current Time: Mon Sep 23 19:50:23 GMT 2024

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

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

Back to the top