Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » UML Activities and Jet
UML Activities and Jet [message #43548] Tue, 25 March 2008 15:33 Go to next message
Eclipse UserFriend
Originally posted by: stenzel.informatik.uni-augsburg.de

Hello to all readers,

I know that my question has been asked before, but still I do not
understand what happens.

I have a simple UML activity as an .uml (in xmi format) created with
Eclipse UML2 tools (see below). I dump this input with the predefined
dump.jet template,
and almost all information is missing: types, attributes, ids.

Why and where is this information lost? The UML Model editor and other EMF
tools
have all the necessary information. Is Jet somehow tailored to class
diagrams?
Or is this a configuration error on my part?

Any help will be appreciated.

Kurt

Input file sample.uml:

<?xml version="1.0" encoding="UTF-8"?>
<uml:Package xmi:version="2.1"
xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
xmi:id="_NM-pAPp-EdyPCoOU_4Ut6A">
<elementImport xmi:id="_NN2LsPp-EdyPCoOU_4Ut6A">
<importedElement xmi:type="uml:PrimitiveType"
href=" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolea n"/>
</elementImport>
<elementImport xmi:id="_NN2Lsfp-EdyPCoOU_4Ut6A">
<importedElement xmi:type="uml:PrimitiveType"
href=" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
</elementImport>
<elementImport xmi:id="_NN2Lsvp-EdyPCoOU_4Ut6A">
<importedElement xmi:type="uml:PrimitiveType"
href=" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Unlimi tedNatural"/>
</elementImport>
<elementImport xmi:id="_NN2Ls_p-EdyPCoOU_4Ut6A">
<importedElement xmi:type="uml:PrimitiveType"
href=" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Intege r"/>
</elementImport>
<packagedElement xmi:type="uml:Activity"
xmi:id="_QGZGIPp-EdyPCoOU_4Ut6A" name="TopAct">
<node xmi:type="uml:OpaqueAction" xmi:id="_Sp0FIPp-EdyPCoOU_4Ut6A"
name="Action1" outgoing="_YsuCwPp-EdyPCoOU_4Ut6A"
incoming="_XaLc0Pp-EdyPCoOU_4Ut6A"/>
<node xmi:type="uml:OpaqueAction" xmi:id="_UA8QIPp-EdyPCoOU_4Ut6A"
name="Action2" incoming="_YsuCwPp-EdyPCoOU_4Ut6A"/>
<node xmi:type="uml:InitialNode" xmi:id="_WG_WoPp-EdyPCoOU_4Ut6A"
outgoing="_XaLc0Pp-EdyPCoOU_4Ut6A"/>
<edge xmi:type="uml:ControlFlow" xmi:id="_XaLc0Pp-EdyPCoOU_4Ut6A"
source="_WG_WoPp-EdyPCoOU_4Ut6A" target="_Sp0FIPp-EdyPCoOU_4Ut6A"/>
<edge xmi:type="uml:ControlFlow" xmi:id="_YsuCwPp-EdyPCoOU_4Ut6A"
source="_Sp0FIPp-EdyPCoOU_4Ut6A" target="_UA8QIPp-EdyPCoOU_4Ut6A"/>
</packagedElement>
</uml:Package>

Result of dump.jet in dump.xml:

<?xml version="1.0" encoding="utf-8"?>
<contents>
<uml:elementImport/>
<uml:elementImport/>
<uml:elementImport/>
<uml:elementImport/>
<uml:packagedElement name="TopAct">
<uml:node name="Action1"/>
<uml:node name="Action2"/>
<uml:node/>
<uml:edge/>
<uml:edge/>
</uml:packagedElement>
</contents>
Re: UML Activities and Jet [message #43796 is a reply to message #43548] Wed, 26 March 2008 14:41 Go to previous message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Kurt:

Heres what's happening:

1) JET 'loads' your .uml file by finding an EMF-registered Resoure.Factory
for .uml files. With it, JET loads the uml file and gets a Resource
implementation that contains UML2 objects such as Model, ....

2) during XPath expression execution, JET is mapping XPath steps to
features/class names of the UML2 metamodel. For example:
/Model/ownedElements/@name does the following matches:

a) the initial / maps to the loaded EMF Resource instance
b) the text Model maps to all contained objects of the Resource whose type
is Model.
c) the text ownedElements maps to all the getOwnedElements() collection of
all objects matched by b)
d) the text @name maps to the getName() method of all objects matched by c)

3) the c:dump tag is trying to render the loaded model as an XML document.
It has no idea that the document was originally serialized as XMI. What it
does is traverse the document using XPath expressions like ./* and ./@*
looking for contained elements and attributes (as the XPath engine sees
them). Because EMF-based models are richer than XML, there are some things
that c:dump does not find. In particular, it doesn't find: xsi:type
information or EReferences that are non-containing. All this is a limitation
of c:dump - The XPath engine can navigate you UML2 model.

Hope this helps.

Paul

"Kurt Stenzel" <stenzel@informatik.uni-augsburg.de> wrote in message
news:be257d35a990098217470c31feb86721$1@www.eclipse.org...
> Hello to all readers,
>
> I know that my question has been asked before, but still I do not
> understand what happens.
>
> I have a simple UML activity as an .uml (in xmi format) created with
> Eclipse UML2 tools (see below). I dump this input with the predefined
> dump.jet template, and almost all information is missing: types,
> attributes, ids.
>
> Why and where is this information lost? The UML Model editor and other EMF
> tools
> have all the necessary information. Is Jet somehow tailored to class
> diagrams?
> Or is this a configuration error on my part?
>
> Any help will be appreciated.
>
> Kurt
>
> Input file sample.uml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <uml:Package xmi:version="2.1"
> xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
> xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
> xmi:id="_NM-pAPp-EdyPCoOU_4Ut6A">
> <elementImport xmi:id="_NN2LsPp-EdyPCoOU_4Ut6A">
> <importedElement xmi:type="uml:PrimitiveType"
> href=" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolea n"/>
> </elementImport>
> <elementImport xmi:id="_NN2Lsfp-EdyPCoOU_4Ut6A">
> <importedElement xmi:type="uml:PrimitiveType"
> href=" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
> </elementImport>
> <elementImport xmi:id="_NN2Lsvp-EdyPCoOU_4Ut6A">
> <importedElement xmi:type="uml:PrimitiveType"
> href=" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Unlimi tedNatural"/>
> </elementImport>
> <elementImport xmi:id="_NN2Ls_p-EdyPCoOU_4Ut6A">
> <importedElement xmi:type="uml:PrimitiveType"
> href=" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Intege r"/>
> </elementImport>
> <packagedElement xmi:type="uml:Activity" xmi:id="_QGZGIPp-EdyPCoOU_4Ut6A"
> name="TopAct">
> <node xmi:type="uml:OpaqueAction" xmi:id="_Sp0FIPp-EdyPCoOU_4Ut6A"
> name="Action1" outgoing="_YsuCwPp-EdyPCoOU_4Ut6A"
> incoming="_XaLc0Pp-EdyPCoOU_4Ut6A"/>
> <node xmi:type="uml:OpaqueAction" xmi:id="_UA8QIPp-EdyPCoOU_4Ut6A"
> name="Action2" incoming="_YsuCwPp-EdyPCoOU_4Ut6A"/>
> <node xmi:type="uml:InitialNode" xmi:id="_WG_WoPp-EdyPCoOU_4Ut6A"
> outgoing="_XaLc0Pp-EdyPCoOU_4Ut6A"/>
> <edge xmi:type="uml:ControlFlow" xmi:id="_XaLc0Pp-EdyPCoOU_4Ut6A"
> source="_WG_WoPp-EdyPCoOU_4Ut6A" target="_Sp0FIPp-EdyPCoOU_4Ut6A"/>
> <edge xmi:type="uml:ControlFlow" xmi:id="_YsuCwPp-EdyPCoOU_4Ut6A"
> source="_Sp0FIPp-EdyPCoOU_4Ut6A" target="_UA8QIPp-EdyPCoOU_4Ut6A"/>
> </packagedElement>
> </uml:Package>
>
> Result of dump.jet in dump.xml:
>
> <?xml version="1.0" encoding="utf-8"?>
> <contents>
> <uml:elementImport/>
> <uml:elementImport/>
> <uml:elementImport/>
> <uml:elementImport/>
> <uml:packagedElement name="TopAct">
> <uml:node name="Action1"/>
> <uml:node name="Action2"/>
> <uml:node/>
> <uml:edge/>
> <uml:edge/>
> </uml:packagedElement>
> </contents>
>
>
Previous Topic:import statement from userRegion are disappearing
Next Topic:JET2 Custom tags problem
Goto Forum:
  


Current Time: Thu Apr 25 23:09:46 GMT 2024

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

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

Back to the top