Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Generate href="pathmap://..."(f)
[ATL] Generate href="pathmap://..." [message #656974] Tue, 01 March 2011 08:53 Go to next message
Ke SUN is currently offline Ke SUNFriend
Messages: 11
Registered: July 2009
Junior Member
Hello,

I'm using ATL to transform to target model UML. In detail, my question is about the generation of "href" in "importedElement".

I want to get the following structure:
<elementImport xmi:type="uml:ElementImport" xmi:id="_OpYhkTp_EeCSALIK68aV3A">
<importedElement xmi:type="uml:PrimitiveType" href=" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Intege r"/>
</elementImport>


However until now, I can only get some structure like the following:
<elementImport xmi:type="uml:ElementImport" xmi:id="_s1Mh4kPgEeC51by4Fq16xw" importedElement="_s1Mh40PgEeC51by4Fq16xw"/>
<uml:PrimitiveType xmi:id="_s1Mh40PgEeC51by4Fq16xw"/>

It's not nested and there is also no "href". Here is the rules I've written:
elementImport_uml:SysML!"uml::ElementImport" (importedElement <- packageableElement_uml),
packageableElement_uml:SysML!"uml::PrimitiveType" ()

Please help me. I'm totally confused.

Thans in advance.
Kind regards,

Kirk
Re: [ATL] Generate href="pathmap://..." [message #657287 is a reply to message #656974] Wed, 02 March 2011 10:46 Go to previous messageGo to next message
Ronan B is currently offline Ronan BFriend
Messages: 273
Registered: July 2009
Senior Member
Hi Kirk,
Pathmaps are tricky to get right. See the following example....

rule AToModel {
from
s : MMA!A
to
t : UML!Model
(
packageImport <- pi
),
pi : UML!PackageImport
(
importedPackage <- UML!Model.allInstancesFrom('DATATYPES')->select(e|e.oclIsTypeOf(UML!Model))- >first()
)
}

This will ensure a custom UML Datatype library is imported and ready for use in an ATL transformation. You can of course alter it to use just some types from the UML Datatype library. Be sure to pass the UML Datatype library into your transformation as a model to be able todo this.

Regards,
Ronan
Re: [ATL] Generate href="pathmap://..." [message #657654 is a reply to message #657287] Thu, 03 March 2011 15:30 Go to previous message
Ke SUN is currently offline Ke SUNFriend
Messages: 11
Registered: July 2009
Junior Member
Thank you so much. This is a very brilliant idea! If without your very kind help, I will be still in a puzzle about that. Very Happy
Previous Topic:[ATL]referencing problem
Next Topic:[ATL] Latest ATL Metamodel in KM3 Format
Goto Forum:
  


Current Time: Thu Apr 15 09:10:20 GMT 2021

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

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

Back to the top