Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Acceleo xmi to java
Acceleo xmi to java [message #841825] Wed, 11 April 2012 19:17 Go to next message
wang jinlong is currently offline wang jinlongFriend
Messages: 1
Registered: April 2012
Junior Member
I have transformed a java project (source file)by using Modisco and obtained a model of java, it's a file .xmi, conforms to Java metamodel java.ecore
and how to transform the file .xmi to java source file(M2T) using Acceleo?
Re: Acceleo xmi to java [message #842426 is a reply to message #841825] Thu, 12 April 2012 09:31 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi,

As long as your xmi file can be opened as an EMF model (you can try through right-click > open with > sample reflective ecore editor : should open without errors), then you can feed it as the input of an Acceleo generation. "Launching an Acceleo generation" is described in the Getting Started guide.

Laurent Goubet
Obeo
Re: Acceleo xmi to java [message #1832989 is a reply to message #842426] Wed, 30 September 2020 12:17 Go to previous messageGo to next message
Clever Alves is currently offline Clever AlvesFriend
Messages: 101
Registered: August 2019
Senior Member
Hi there!

Can I use Acceleo to convert the simple diagram below in XMI to plain XML or Java?

<?xml version="1.0" encoding="UTF-8"?>
<hccm:HCCM xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:hccm="singleServerQueue">
<nodes xsi:type="hccm:Event" outgoing_transition="//@transitions.0" name="Arrival"/>
<nodes xsi:type="hccm:Activity" outgoing_transition="//@transitions.1" incoming_transition="//@transitions.0" name="Wait"/>
<nodes xsi:type="hccm:Activity" outgoing_transition="//@transitions.2" incoming_transition="//@transitions.1" name="Service"/>
<nodes xsi:type="hccm:Event" incoming_transition="//@transitions.2" name="Departure"/>
<transitions xsi:type="hccm:Arrow" start_node="//@nodes.0" finish_node="//@nodes.1"/>
<transitions xsi:type="hccm:Arrow" start_node="//@nodes.1" finish_node="//@nodes.2"/>
<transitions xsi:type="hccm:Arrow" start_node="//@nodes.2" finish_node="//@nodes.3"/>
</hccm:HCCM>

Thank you for your attention.
Re: Acceleo xmi to java [message #1833022 is a reply to message #1832989] Wed, 30 September 2020 18:17 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7670
Registered: July 2009
Senior Member
Hi

Acceleo is an M2T tool, so model to Java is within scope.

But XMI to XML is a M2M task so Acceleo is a poor, but not impossible choice.

Regards

Ed Willink
Re: Acceleo xmi to java [message #1833175 is a reply to message #1832989] Mon, 05 October 2020 14:41 Go to previous message
Fatima Rani is currently offline Fatima RaniFriend
Messages: 22
Registered: April 2020
Junior Member
i think you can create the xml and java file but problem is that to read that xmi in acceleo, i am also working some thing like this ,i am trying to read the following two files but not succeeded yet !
file1:
<?xml version="1.0" encoding="UTF-8"?>
<abcd:PetriNet xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:abcd="https://petrinetdsl">
<places name="place1"/>
<places name="place2"/>
<arcsn2t name="arcP2T1" source="//@places.0" target="//@transitions.0"/>
<arcst2n name="arcT2P1" source="//@transitions.0" target="//@places.1"/>
<transitions name="transition1"/>
<tokens name="token1" idToken="1"/>
<tokens name="token2" idToken="2"/>
</abcd:PetriNet>
file2:
<?xml version="1.0" encoding="UTF-8"?>
<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:abcd="https://petrinetdsl" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.3/notation" xmi:id="_qxqjYPENEeq3XO_vroMpcQ" type="Petrinetdsl" name="default.petrinetdsl_diagram" measurementUnit="Pixel">
<children xmi:type="notation:Node" xmi:id="_s6AI4PENEeq3XO_vroMpcQ" type="2001">
<children xmi:type="notation:DecorationNode" xmi:id="_s6ClIPENEeq3XO_vroMpcQ" type="5001">
<layoutConstraint xmi:type="notation:Location" xmi:id="_s6ClIfENEeq3XO_vroMpcQ" y="5"/>
</children>
<styles xmi:type="notation:DescriptionStyle" xmi:id="_s6AI4fENEeq3XO_vroMpcQ"/>
<element xmi:type="abcd:Place" href="default.petrinetdsl#//@places.0"/>
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_s6AI4vENEeq3XO_vroMpcQ" x="388" y="124" width="61" height="59"/>
</children>
<children xmi:.....
Previous Topic:How to start in acceleo?
Next Topic:how to read Eugenia diagram model in Acceleo?
Goto Forum:
  


Current Time: Thu Sep 26 04:40:34 GMT 2024

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

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

Back to the top