Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] getAppliedStereotypes returns emptyList
[ATL] getAppliedStereotypes returns emptyList [message #61439] Mon, 10 September 2007 12:37 Go to next message
Eclipse UserFriend
Originally posted by: schwaban.web.de

Hello,

I do have a problem with finding the applied stereotypes for an
UML!Element by calling self.getAppliedStereotypes() within an atl.file,
where self refers to an UML!Element. It always returns an empty list.

module Stundenplan; -- Module Template
create OUT : DotNetCFUsecaseProfile from IN : UML;

helper context UML!Element def : hasStereotypes() : Boolean =
not self.getAppliedStereotypes()->isEmpty();

rule ClassToTabPage {
from a : UML!Element ( if a.hasStereotypes() then true else false endif
)
to b : DotNetCFUsecaseProfile!systemWindowsFormsTabPage ()
}

My model is an UML 2.0 compliant export from MagicDraw 12.5 and looks
like the following small(!) extract.
Is there something wrong with this export format from MagicDraw?
What has to be considered in general to call methods like
getAppliedStereotypes() from an atl.file? Are their any preconditions in
configuring the ATL launch?

Thanks for all answers!

Andreas Schwab

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.1"
xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:DotNetCFUsecaseProfile=" http:///schemas/DotNetCFUsecaseProfile/_mMvpMF1BEdyjeLfg7Wth KQ/0"
xmlns:MagicDrawProfile="http:///schemas/MagicDrawProfile/_mNCkIF1BEdyjeLfg7WthKQ/0"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:uml="http://www.eclipse.org/uml2/2.0.0/UML"
xsi:schemaLocation=" http:///schemas/DotNetCFUsecaseProfile/_mMvpMF1BEdyjeLfg7Wth KQ/0
DotNetCFUsecaseProfile.profile.uml#_mk4h-11BEdyjeLfg7WthKQ
http:///schemas/MagicDrawProfile/_mNCkIF1BEdyjeLfg7WthKQ/0
UML_Standard_Profile.MagicDraw_Profile.profile.uml#_mkurYl1B EdyjeLfg7WthKQ ">

<uml:Model xmi:id="eee_1045467100313_135436_1" name="Stundenplan">

<packageImport xmi:id="_0primitiveTypesStundenplan">
<importedPackage xmi:type="uml:Model"
href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
</packageImport>
<packageImport xmi:id="_0javaPrimitiveTypesStundenplan">
<importedPackage xmi:type="uml:Model"
href="pathmap://UML_LIBRARIES/JavaPrimitiveTypes.library.uml#_0"/>
</packageImport>

<packagedElement xmi:type="uml:Class"
xmi:id="_12_5_1_26a50537_1188557378093_640652_266"
name="StundenplanOverview"
clientDependency="_12_5_1_26a50537_1188576498500_255468_350
_12_5_1_26a50537_1188765797468_535944_1465
_12_5_1_26a50537_1188559292593_408506_1458
_12_5_1_26a50537_1188766781171_566538_1745"/>

.... (some more packagedElements) ...

<profileApplication
xmi:id=" _12_5_1_22920507_1188474942281_730654_253profileApplicationS tundenplan ">
<eAnnotations xmi:id="_mlCPGF1BEdyjeLfg7WthKQ"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href="DotNetCFUsecaseProfile.profile.uml#_mk4h-11BEdyjeLfg7WthKQ "/>
</eAnnotations>
<appliedProfile
href=" DotNetCFUsecaseProfile.profile.uml#_12_5_1_22920507_11884749 42281_730654_253 "/>
</profileApplication>
<profileApplication
xmi:id=" _be00301_1073394351331_445580_2profileApplicationStundenplan ">
<eAnnotations xmi:id="_mlCPHF1BEdyjeLfg7WthKQ"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href=" UML_Standard_Profile.MagicDraw_Profile.profile.uml#_mkurYl1B EdyjeLfg7WthKQ "/>
</eAnnotations>
<appliedProfile
href=" UML_Standard_Profile.MagicDraw_Profile.profile.uml#_be00301_ 1073394351331_445580_2 "/>
</profileApplication>
.... (some more profile applications that seem to be exported by default
and are of no relevance for this problem)...

</uml:Model>

<DotNetCFUsecaseProfile:systemWindowsFormsPanel
xmi:id="_p0TlwF1BEdyjeLfg7WthKQ"
base_Class="_12_5_1_26a50537_1188557378093_640652_266" bgColor="#DDDDDD"
title="Stundenplan"
base_Element="_12_5_1_26a50537_1188557378093_640652_266"/>

.... (some more applications of this Profile) ...

<MagicDrawProfile:auxiliaryResource xmi:id="_rQ11MF1BEdyjeLfg7WthKQ"
base_Package="magicdraw_uml_standard_profile_v_0001"/>

</xmi:XMI>
Re: [ATL] getAppliedStereotypes returns emptyList [message #61518 is a reply to message #61439] Mon, 10 September 2007 13:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: freddy.allilaire.univ-nantes.fr

Hello Andreas,

Does your input model contain the profile?

If your profile is defined in another UML model, you should add it in
the ATL header and the launch configuration. For example:
create OUT : DotNetCFUsecaseProfile from IN : UML, PRO : UML;

Regards,
Freddy.

Andreas Schwab a écrit :
> Hello,
>
> I do have a problem with finding the applied stereotypes for an
> UML!Element by calling self.getAppliedStereotypes() within an atl.file,
> where self refers to an UML!Element. It always returns an empty list.
>
> module Stundenplan; -- Module Template
> create OUT : DotNetCFUsecaseProfile from IN : UML;
>
> helper context UML!Element def : hasStereotypes() : Boolean =
> not self.getAppliedStereotypes()->isEmpty();
>
> rule ClassToTabPage {
> from a : UML!Element ( if a.hasStereotypes() then true else false endif
> )
> to b : DotNetCFUsecaseProfile!systemWindowsFormsTabPage ()
> }
>
> My model is an UML 2.0 compliant export from MagicDraw 12.5 and looks
> like the following small(!) extract.
> Is there something wrong with this export format from MagicDraw?
> What has to be considered in general to call methods like
> getAppliedStereotypes() from an atl.file? Are their any preconditions in
> configuring the ATL launch?
>
> Thanks for all answers!
>
> Andreas Schwab
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xmi:XMI xmi:version="2.1"
> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:DotNetCFUsecaseProfile=" http:///schemas/DotNetCFUsecaseProfile/_mMvpMF1BEdyjeLfg7Wth KQ/0"
>
> xmlns:MagicDrawProfile="http:///schemas/MagicDrawProfile/_mNCkIF1BEdyjeLfg7WthKQ/0"
>
> xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
> xmlns:uml="http://www.eclipse.org/uml2/2.0.0/UML"
> xsi:schemaLocation=" http:///schemas/DotNetCFUsecaseProfile/_mMvpMF1BEdyjeLfg7Wth KQ/0
>
> DotNetCFUsecaseProfile.profile.uml#_mk4h-11BEdyjeLfg7WthKQ
> http:///schemas/MagicDrawProfile/_mNCkIF1BEdyjeLfg7WthKQ/0
> UML_Standard_Profile.MagicDraw_Profile.profile.uml#_mkurYl1B EdyjeLfg7WthKQ ">
>
>
> <uml:Model xmi:id="eee_1045467100313_135436_1" name="Stundenplan">
>
> <packageImport xmi:id="_0primitiveTypesStundenplan">
> <importedPackage xmi:type="uml:Model"
> href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
> </packageImport>
> <packageImport xmi:id="_0javaPrimitiveTypesStundenplan">
> <importedPackage xmi:type="uml:Model"
> href="pathmap://UML_LIBRARIES/JavaPrimitiveTypes.library.uml#_0"/>
> </packageImport>
>
> <packagedElement xmi:type="uml:Class"
> xmi:id="_12_5_1_26a50537_1188557378093_640652_266"
> name="StundenplanOverview"
> clientDependency="_12_5_1_26a50537_1188576498500_255468_350
> _12_5_1_26a50537_1188765797468_535944_1465
> _12_5_1_26a50537_1188559292593_408506_1458
> _12_5_1_26a50537_1188766781171_566538_1745"/>
>
> ... (some more packagedElements) ...
>
> <profileApplication
> xmi:id=" _12_5_1_22920507_1188474942281_730654_253profileApplicationS tundenplan ">
>
> <eAnnotations xmi:id="_mlCPGF1BEdyjeLfg7WthKQ"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href="DotNetCFUsecaseProfile.profile.uml#_mk4h-11BEdyjeLfg7WthKQ "/>
> </eAnnotations>
> <appliedProfile
> href=" DotNetCFUsecaseProfile.profile.uml#_12_5_1_22920507_11884749 42281_730654_253 "/>
>
> </profileApplication>
> <profileApplication
> xmi:id=" _be00301_1073394351331_445580_2profileApplicationStundenplan ">
> <eAnnotations xmi:id="_mlCPHF1BEdyjeLfg7WthKQ"
> source="http://www.eclipse.org/uml2/2.0.0/UML">
> <references xmi:type="ecore:EPackage"
> href=" UML_Standard_Profile.MagicDraw_Profile.profile.uml#_mkurYl1B EdyjeLfg7WthKQ "/>
>
> </eAnnotations>
> <appliedProfile
> href=" UML_Standard_Profile.MagicDraw_Profile.profile.uml#_be00301_ 1073394351331_445580_2 "/>
>
> </profileApplication>
> ... (some more profile applications that seem to be exported by default
> and are of no relevance for this problem)...
>
> </uml:Model>
>
> <DotNetCFUsecaseProfile:systemWindowsFormsPanel
> xmi:id="_p0TlwF1BEdyjeLfg7WthKQ"
> base_Class="_12_5_1_26a50537_1188557378093_640652_266" bgColor="#DDDDDD"
> title="Stundenplan"
> base_Element="_12_5_1_26a50537_1188557378093_640652_266"/>
>
> ... (some more applications of this Profile) ...
>
> <MagicDrawProfile:auxiliaryResource xmi:id="_rQ11MF1BEdyjeLfg7WthKQ"
> base_Package="magicdraw_uml_standard_profile_v_0001"/>
>
> </xmi:XMI>


--
Freddy Allilaire - ATLAS Group (INRIA & LINA)
http://www.sciences.univ-nantes.fr/lina/atl/contrib/allilair e
Re: [ATL] getAppliedStereotypes returns emptyList [message #61579 is a reply to message #61518] Mon, 10 September 2007 14:45 Go to previous message
Eclipse UserFriend
Originally posted by: schwaban.web.de

Hello Freddy,

:-))
thanks a lot! That was indeed the solution. I included the profile.
Otherwise the references to the stereotype couldn't be resolved.

Cheers
Andreas

Freddy Allilaire schrieb:
> Hello Andreas,
>
> Does your input model contain the profile?
>
> If your profile is defined in another UML model, you should add it in
> the ATL header and the launch configuration. For example:
> create OUT : DotNetCFUsecaseProfile from IN : UML, PRO : UML;
>
> Regards,
> Freddy.
Previous Topic:Working with Dates
Next Topic:[ATL] ATL Port to Eclipse Linux
Goto Forum:
  


Current Time: Fri Apr 19 03:45:37 GMT 2024

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

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

Back to the top