Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] how to convert relationName among two classes into Element in XML as Target
[ATL] how to convert relationName among two classes into Element in XML as Target [message #552953] Sun, 15 August 2010 05:25 Go to next message
Transformed is currently offline TransformedFriend
Messages: 21
Registered: June 2010
Junior Member
Hi all,
I have an ecore model with Process class containing variable class with Variables association name and partnerLink class with partnerLinks association name as shown below.
		|--{Variables}--> |variable|
|Process| <composite>  
		|--{partnerLinks}--> |partnerLink|

The respective XMI instance looks like this
<BPEL:Process xmlns:xsi=""name="ManRoleType" targetNameSpace="">
  <variables name="POChannelInstance"/>
  <variables name="CPUnotInStock"/>
  <partnerLinks name="CustRoleType"/>
  <partnerLinks name="SupCPURoleType"/>

I am using AM3 extractor to generate an XML document which looks like this
<process >
		<partnerLink name=CustRoleType />
		<partnerLink name=SupCPURoleType/>
		<varilable name= POChannelInstance/>
		<varilable name= CPUnotInStock/>

Now, my problem is how can I specify those relationnames namely partnerLinks and variables into as an Element of XML.?

Following ATL code does not help.
rule Process2Root{
		s	:	BPEL!Process
		t	:	XML!Root(
			name <- 'process',
			children <- Sequence{xmlns, name, partnerLinks}
	xmlns	:	XML!Attribute(
		name <- 'xmlns',
		value <- ''
		name	:	XML!Attribute(
			name <- 'name',
		 value <- ),
partnerLinks:	XML!Element(
			name <- 'partnerLinks'	

rule prtnerlinks2Elements (
from s: BPEL!PartnerLinks <!-- This is error now as BPEL metamodle does not have PartnerLinks as class -->

How should I work out to make partnerLinks and variables as elemtents that contains partnerlink and variable respectively?


[Updated on: Sun, 15 August 2010 06:07]

Report message to a moderator

Re: [ATL] how to convert relationName among two classes into Element in XML as Target [message #553050 is a reply to message #552953] Mon, 16 August 2010 09:19 Go to previous message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
You can't transform relations but you transform elements. Try to transform each BPEL!PartnerLink to a XML!Element partnerLink with an attribute name with the name of the PartnerLink and then the partnerLinks relation is transformed to :

partnerLinks: XML!Element(
name <- 'partnerLinks',
children <- s.partnerLinks
Previous Topic:[ATL] How to generate customized name spaces in an element?
Next Topic:[QVTo] Two new QVTo bugs...
Goto Forum:

Current Time: Sun Jun 07 10:56:26 GMT 2020

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

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

Back to the top