[ATL] MARTE profile [message #97833] |
Mon, 19 January 2009 23:38  |
Eclipse User |
|
|
|
Hi,
I applied some stereotypes from MARTE profile to my input model. When I
tried to select an element according to its stereotype, ATL couldnt see
the stereotyped element and I got empty target model and didnt 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 couldnt know which library to add
and from where as I dont have MARTE profile in the EMF Registry in the
run configuration.
Any hint is greatly appreciated,
Rasha
|
|
|
|
|
Re: [ATL] MARTE profile [message #98206 is a reply to message #98191] |
Fri, 23 January 2009 08:24   |
Eclipse User |
|
|
|
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 #99535 is a reply to message #98866] |
Thu, 12 February 2009 05:34  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.26722 seconds