Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » Reading and writing UML file with MWE Workflow
icon5.gif  Reading and writing UML file with MWE Workflow [message #638476] Thu, 11 November 2010 12:41 Go to next message
Tom Brandenburg is currently offline Tom Brandenburg
Messages: 58
Registered: October 2010
Location: Abstatt, Germany
Member
Hello everybody,

currently I am learning how to deal with workflows, as well as XMI reader and writer. For testing purposes I want to read in an UML file and write it back with this code:

<?xml version="1.0"?>
<workflow>
    <!-- Set Properties -->
    <property name="model" value="src/model/test.uml" />
    <property name="dump" value="src/model/test_dump.uml" />
    <property name="src-gen" value="src-gen" />
    
    <!-- Set UML environment -->
    <bean class="org.eclipse.xtend.typesystem.uml2.Setup" standardUML2Setup="true"/>
    
    <!-- Read in the model -->
    <component class="org.eclipse.emf.mwe.utils.Reader">
        <modelSlot value="model"/>
        <uri value="${model}"/>
    </component>

    <!-- Write the model -->
    <component class="org.eclipse.emf.mwe.utils.Writer">
        <modelSlot value="model"/>
        <uri value="${dump}"/>
    </component>    
</workflow>


The test file looks like this:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.1" xmlns:uml="http://schema.omg.org/spec/UML/2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1">
	<xmi:Documentation exporter="Bouml" exporterVersion="1.15"/>
	<uml:Model xmi:type="uml:Model" xmi:id="themodel" name="UMLTest">
		<packagedElement xmi:type="uml:Package" xmi:id="BOUML_0x81_22" name ="UMLTest">
			<packagedElement xmi:type="uml:Package" xmi:id="BOUML_0x20e17_22" name ="Test 1">
			</packagedElement>
			<packagedElement xmi:type="uml:Package" xmi:id="BOUML_0x22797_22" name ="Test 2">
			</packagedElement>
		</packagedElement>
	</uml:Model>
</xmi:XMI>


The reading and writing works, but only the first found <xmi:Documentation...> is print out:

<?xml version="1.0" encoding="UTF-8"?>
<xmi:Documentation xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmi:id="_dUeaUO2OEd-L6o14zz6gjQ" exporter="Bouml" exporterVersion="1.15"/>


I have two questions:
1. How I can force the Reader/Writer to also recognize all elements?
2. How I can set the file encoding of the Writer to ISO-8859-1?

Thanks in advance and I am eager for your answers Smile

Cheers,
Tom
Re: Reading and writing UML file with MWE Workflow [message #638825 is a reply to message #638476] Fri, 12 November 2010 16:52 Go to previous messageGo to next message
Rafael Chaves is currently offline Rafael Chaves
Messages: 161
Registered: July 2009
Senior Member
Tom,

This is not the best newsgroup to talk about transformations and code generation (emft and m2t might be better suited).

Not knowing a single thing about MWE and Xpand, I'd guess one of your problems might be the fact that the schema URI you are using for the UML namespace is not the one Eclipse UML2 normally expects, but I noticed you started a different thread for that issue. I will let other more knowledgeable folks to help you with how to address that part of the problem.

Re: Reading and writing UML file with MWE Workflow [message #638832 is a reply to message #638476] Fri, 12 November 2010 17:17 Go to previous messageGo to next message
Tom Brandenburg is currently offline Tom Brandenburg
Messages: 58
Registered: October 2010
Location: Abstatt, Germany
Member
Hello Rafael,

ok, you're might be right. At first I thought to post it here because somehow I thought that UML is in the focus here. Maybe the focus changed during formulating the thread Smile
I am quite new to the EMF topic and even new to this newsgroup, so I have to adapt and orientate myself - but it's evolving Smile

Thanks and bye
Tom
Re: Reading and writing UML file with MWE Workflow [message #638863 is a reply to message #638832] Fri, 12 November 2010 19:38 Go to previous message
Rafael Chaves is currently offline Rafael Chaves
Messages: 161
Registered: July 2009
Senior Member
No problem, there are a lot of modeling-related newsgroups @ Eclipse.org so it can be challenging to find the best forum for a question. Your other thread on why Eclipse UML2 cannot load properly the XMI you got from BoUML is very relevant for this group though.

[Updated on: Fri, 12 November 2010 19:38]

Report message to a moderator

Previous Topic:How to create property value of a Slot
Next Topic:Applying Stereotypes programatically returns IllegalArgumentException
Goto Forum:
  


Current Time: Sat Sep 20 18:19:00 GMT 2014

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

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