Skip to main content



      Home
Home » Archived » M2M (model-to-model transformation) » [ATL] MARTE profile
[ATL] MARTE profile [message #97833] Mon, 19 January 2009 23:38 Go to next message
Eclipse UserFriend
Hi,

I applied some stereotypes from MARTE profile to my input model. When I
tried to select an element according to its stereotype, ATL couldn’t see
the stereotyped element and I got empty target model and didn’t raise any
error. I have UML profile for MARTE 1.0.3 as a plug-in. When I included
this line in my code 'uses MARTE', I couldn’t know which library to add
and from where as I don’t have MARTE profile in the EMF Registry in the
run configuration.

Any hint is greatly appreciated,

Rasha
Re: [ATL] MARTE profile [message #98103 is a reply to message #97833] Thu, 22 January 2009 12:07 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

Rasha a écrit :
> Hi,
>
> I applied some stereotypes from MARTE profile to my input model. When I
> tried to select an element according to its stereotype, ATL couldn?t see
> the stereotyped element

How do you access stereotypes ? Could you paste her an excerpt of your
ATL code ?
You must use the UML2 api to access stereotypes:
http://download.eclipse.org/tools/uml2/2.1.0/javadoc/org/ecl ipse/uml2/uml/Element.html#getAppliedStereotypes()

Regards

William
> and I got empty target model and didn?t raise
> any error. I have UML profile for MARTE 1.0.3 as a plug-in. When I
> included this line in my code 'uses MARTE', I couldn?t know which
> library to add and from where as I don?t have MARTE profile in the EMF
> Registry in the run configuration.
> Any hint is greatly appreciated,
>
> Rasha
>
Re: [ATL] MARTE profile [message #98191 is a reply to message #98103] Fri, 23 January 2009 07:32 Go to previous messageGo to next message
Eclipse UserFriend
Hi William,

I’m trying to copy a stereotype and its properties from the source to the
target model. The source model is applied the MARTE profile. But sience I
don’t know how to import the MARTE profile to my transformation file, I
used my own defined profile.
I tried to copy the stereotype with the same way as any model element is
copied.

create OUT : UML from IN : UML, PRO : UML;

rule Lifeline{
from
s : UML!Lifeline
to
t : UML!Lifeline(
name <- s.name,
stereotype <- s.stereotype ->collect(e|thisModule.Stereotype(e))
)}
lazy rule Stereotype{
from
s : UML!Stereotype
to
t : UML!Stereotype(
name <- s.name
)}
But it doesn’t work since feature stereotype does not exist on
UML!Lifeline.

So, I tried to apply the profile to the target model

helper def : MyStereotype : UML!Stereotype = OclUndefined;

rule Model{
from
s : UML!Model
to
t : UML!Model(
name <- s.name
)

do {t.applyProfile(UML!Profile.allInstancesFrom('PRO')->select(p | p.name
='MyProfile')->first());

thisModule.MyStereotype <- UML!Profile.allInstancesFrom('PRO')->select(p |
p.name=' MyProfile ')
->first().ownedStereotype->select(s | s.name='MyStereotype')->first();
}}

rule Lifeline{
from
s : UML!Lifeline
to
t : UML!Lifeline(
name <- s.name
)
do{
t.applyStereotype(thisModule.MyStereotype);
}}

But I got an error
ERROR: exception during invocation of operation applyStereotype on
UML!Lifeline (java method: public org.eclipse.emf.ecore.EObject
org.eclipse.uml2.uml.internal.impl.ElementImpl.applyStereoty pe(org.eclipse.uml2.uml.Stereotype))

Thanks for your help,

Rasha
Re: [ATL] MARTE profile [message #98206 is a reply to message #98191] Fri, 23 January 2009 08:24 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

If you want to do an exact copy of the source model (stereotyped) to
target model (same sterotypes as source), you can try the ATL 3.0
refining mode.

Rasha a écrit :
> Hi William,
>
> I?m trying to copy a stereotype and its properties from the source to
> the target model. The source model is applied the MARTE profile. But
> sience I don?t know how to import the MARTE profile to my transformation

I assume that you're talking about a built-in profile (in an installed
plugin). Next ATL build (at least M5 galileo, so 6 feb, maybe sooner)
will provide a way to load a profile using the "pathmap:" prefix in
place of "uri:". This feature is ever available on the CVS HEAD.

> file, I used my own defined profile. I tried to copy the stereotype with
> the same way as any model element is copied.
>
> create OUT : UML from IN : UML, PRO : UML;
> rule Lifeline{
> from
> s : UML!Lifeline to t : UML!Lifeline(
> name <- s.name,
> stereotype <- s.stereotype
*snip*

This can't work, UML2 only allows to manage stereotypes through its API.

> ->collect(e|thisModule.Stereotype(e))
> )}
> lazy rule Stereotype{
> from
> s : UML!Stereotype to t : UML!Stereotype(
> name <- s.name
> )}
> But it doesn?t work since feature stereotype does not exist on
> UML!Lifeline.
>
> So, I tried to apply the profile to the target model
>
> helper def : MyStereotype : UML!Stereotype = OclUndefined;
>
> rule Model{
> from
> s : UML!Model to t : UML!Model( name
> <- s.name
> )
>
> do {t.applyProfile(UML!Profile.allInstancesFrom('PRO')->select(p |
> p.name ='MyProfile')->first());
>
> thisModule.MyStereotype <- UML!Profile.allInstancesFrom('PRO')->select(p
> | p.name=' MyProfile ')
> ->first().ownedStereotype->select(s | s.name='MyStereotype')->first(); }}
>
> rule Lifeline{
> from
> s : UML!Lifeline to t : UML!Lifeline(
> name <- s.name
> )
> do{
> t.applyStereotype(thisModule.MyStereotype);
> }}
>
> But I got an error
> ERROR: exception during invocation of operation applyStereotype on
> UML!Lifeline (java method: public org.eclipse.emf.ecore.EObject
> org.eclipse.uml2.uml.internal.impl.ElementImpl.applyStereoty pe(org.eclipse.uml2.uml.Stereotype))
>
>

Is it the complete exception ?

There can be many reasons here. Note that ATL rules execution order is
undefined, so maybe :
- the stereotype is applied before the profile
=> if you use RegularVM, use UML2 modelhandler for the output model
=> if you use EMFVM, check the "Support UML2 stereotypes" in the
Advanced tab of the launch config
- the MyStereotype variable isn't initialized when you apply it
- ?

Whatever, you should try to use debug('') method inside of your code to
see what is undefined.

ex:
t.applyStereotype(thisModule.MyStereotype.debug(''));

Best Regards,

William

> Thanks for your help,
>
> Rasha
>
>
Re: [ATL] MARTE profile [message #98249 is a reply to message #98206] Fri, 23 January 2009 09:32 Go to previous messageGo to next message
Eclipse UserFriend
Thanks William for this prompt reply! In some cases, I need to exact copy
the same stereotypes of the source model to target model. Where I can find
examples of using the ATL 3.0 refining mode and from where I can download
ATL 3.0? The latest version I have is ATL 2.2.

Yes, MARTE is a built-in profile which is an installed plugin. It is
already installed as UML profile for MARTE 1.0.3. So far, it is not
supported by ATL 2.2. to import this plugin into the transformation file.

I’m using Regular VM and UML2 model handler. I’ll use debug() method
inside of my code to see what is undefined.

You help is greatly appreciated,

Rasha
Re: [ATL] MARTE profile [message #98264 is a reply to message #98249] Fri, 23 January 2009 09:51 Go to previous messageGo to next message
Eclipse UserFriend
Answers below:

Rasha a écrit :
> Thanks William for this prompt reply! In some cases, I need to exact
> copy the same stereotypes of the source model to target model. Where I
> can find examples of using the ATL 3.0 refining mode and from where I
> can download ATL 3.0? The latest version I have is ATL 2.2.

http://www.eclipse.org/modeling/m2m/downloads/index.php?proj ect=atl

3.0 is not at the top of the page as it is not yet a "Release", but a
"Milestone" version of the final Galileo Release.

An refining example is embedded into that build. (New->Example->ATL->...).

>
> Yes, MARTE is a built-in profile which is an installed plugin. It is
> already installed as UML profile for MARTE 1.0.3. So far, it is not
> supported by ATL 2.2. to import this plugin into the transformation file.
>
> I?m using Regular VM and UML2 model handler. I?ll use debug() method
> inside of my code to see what is undefined.
>
> You help is greatly appreciated,

You're welcome !

>
> Rasha
>
>
Re: [ATL] MARTE profile [message #98511 is a reply to message #98264] Tue, 27 January 2009 09:17 Go to previous messageGo to next message
Eclipse UserFriend
Hi William,
I tried the refining mode in ATL 3.0 and it works fine to copy everything,
but I have to apply two profiles to the source model. One of them, I need
to copy it from the source to the target model as it is; there is no
problem with this one. But the other profile, I need to get rid of it
completely in the target model. Is there any way to mix between the
“refining” and “from” modes according to the profile? Or another way after
copied everything in the target model to reapply “delete” the other
profile from the target model?

Any hints will be great!

Rasha
[ATL] MARTE profile [message #98866 is a reply to message #97833] Sat, 31 January 2009 05:29 Go to previous messageGo to next message
Eclipse UserFriend
Hi Rasha,
I am trying to annotate my input model which is the UML class diagram with
MARTE profile.I will be using ATL 2.0.1 for transformation.I have
installed UML profile for MARTE 1.1.2 and I am using the regularVM.
Your help would be highly appreciated.
Thanks and Regards
Rodrigues
Re: [ATL] MARTE profile [message #99535 is a reply to message #98866] Thu, 12 February 2009 05:34 Go to previous message
Eclipse UserFriend
Hi,

This article is great and the people which participated on them are
fantastic.

First, I would like to ask which program you are using to annotate UML
diagrams with the MARTE profile?

I stereotype the UML profile for MARTE with Papyrus. This is a plugging
for eclipse.

I'm new with ATL.
I would like to know, how to transform with ATL the Papyrus models.
For example I have a MARTE GRM model and I want to transform it into a SAM
model.

Many doubts I have now:
- How to capture the stereotypes from the source model?
- Can I use the file extension UML from Papyrus as source model?

Thanks in advance.
Previous Topic:[ATL] Helpers not acting as expected in my lazy rule
Next Topic:Creation of new subordinate classes in transformation
Goto Forum:
  


Current Time: Fri Jul 18 19:46:15 EDT 2025

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

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

Back to the top