Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMT (Generative Modeling Technologies) » Unexpected output
Unexpected output [message #552638] Fri, 13 August 2010 01:43 Go to next message
Transformed is currently offline Transformed
Messages: 21
Registered: June 2010
Junior Member
Hi all,
I am having problem with output format of the XML file.

The xml.km3 file is like this
package PrimitiveTypes {
datatype Boolean;
datatype Integer;
datatype String;
}
package XML {
abstract class Node {
reference parent[0-1] : Element oppositeOf children;
attribute startLine[0-1] : Integer;
attribute startColumn[0-1] : Integer;
attribute endLine[0-1] : Integer;
attribute endColumn[0-1] : Integer;
attribute name : String;
attribute value : String;
}
class Attribute extends Node {
}
class Text extends Node {
}
class Element extends Node {
reference children[*] ordered container : Node oppositeOf parent;
}
class Root extends Element {
}
}

here is my XMI input file for the ATL code presented below.
sample XMI (IN:BPEL) file
<?xml version="1.0" encoding="ISO-8859-1"?>
<BPEL:Process xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:BPEL="uri:BPEL.ecore" name="ManRoleType" targetNameSpace="http://example .org/build2order">

This is my ATL file with the rule.
--******************ATL FILE ************
module BPEL2XML;
create OUT : XML from IN : BPEL;
rule Process2Root{
from
s : BPEL!Process( ]
s.oclIsTypeOf(BPEL!Process)
)
to
t : XML!Root(
name <- 'process',
children <- Sequence{xmlns, name}
),
xmlns : XML!Attribute(
name <- 'xmlns',
value <- 'http://myproject.com/wsbpel'
),

name : XML!Attribute(
name <- 'name',
value <- s.name
)
************************************************** *******

This is my output which is not as I had expected.
Output
<?xml version="1.0" encoding="ISO-8859-1"?>
<Root xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="XML" name="process">
  <children xsi:type="Attribute" name="xmlns" value="http://docs.oasis-open.org/wsbpel/2.0/process/abstract"/>
  <children xsi:type="Attribute" name="name" value="ManRoleType"/>
</Root>

This is my expected output.
-----------> Expected output <---------------------
Expected Output
<?xml version="1.0" encoding="ISO-8859-1"?>
<process name="ManRoleType xmlns="http://myproject.com/wsbpel">
</process>

What sort of changes should I make in ATL rule so that I will get the expected output of BPEL file.

Thanking in advance!

[Updated on: Fri, 13 August 2010 02:23]

Report message to a moderator

Re: Unexpected output [message #552748 is a reply to message #552638] Fri, 13 August 2010 11:28 Go to previous message
Transformed is currently offline Transformed
Messages: 21
Registered: June 2010
Junior Member
Hi,

I wanted to used AM3 for the above case but I just tried the above mentioned ATL transformation with out installing AM3.

Does this also make difference?

Thanks
Previous Topic:Generate code SQL in Eclipse
Next Topic:MOFScript Java execution failing with PackageNotFoundException
Goto Forum:
  


Current Time: Sun Oct 26 07:06:02 GMT 2014

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

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