Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Problem with Child and Parent Elements in resulting XMI File
Problem with Child and Parent Elements in resulting XMI File [message #1824343] Tue, 14 April 2020 07:30 Go to next message
Andreas Bäuerle is currently offline Andreas BäuerleFriend
Messages: 11
Registered: April 2020
Junior Member
Good Morning.

I am still working on my transformation, and came up to a new problem. I am transforming a Model into another target Model using ATL. The target model however does not show the parent child structure I wish for.

For example:
Wish:
<Model name="bla">
<packagedElement name="bla"/>
</Model>

Is:
<Model name="bla"/>
<packagedElement name="bla"/>


I'm not sure what I am doing wrong. I'm still learning...

Is this a problem in the .atl file or in the meta model?

ATL code:

rule trace2Model {
from
s : TDT!trace
to
t : SD!Model (
name <- 'bla'
)
}

rule system2packagedElement {
from
s : TDT!system
to
t : SD!packagedElement (
name <- 'bla'
)
}

The metamodel consists of two elements the Model and the packaged Element. Both have a attribute and the reference to each other. I adjusted the Container and Containment property.


Any help is appreciated. Thank you!

Re: Problem with Child and Parent Elements in resulting XMI File [message #1826233 is a reply to message #1824343] Tue, 21 April 2020 15:47 Go to previous message
Andon¡ Reteg¡ is currently offline Andon¡ Reteg¡Friend
Messages: 4
Registered: February 2020
Junior Member
Hi Andreas,

In my case, I'm working on a UML2UML refining transformation but I solved this problem by adding the reference of the packagedElement into the Model element transformation.

My Model transformation looks like this in order to have the packageElement inside:

rule modelCopy{
from m_in: Input!Model
to x: Output!Model (
name <- m_in.name,
packagedElement <- m_in.packagedElement
)
}
-----------------------------------------------------------

Im not sure how it would look for your ATL code, but you could try something like this :

rule trace2Model {
from
s : TDT!trace
to
t : SD!Model (
name <- 'bla',
packagedElement <-'bla'
)
}

rule system2packagedElement {
from
s : TDT!system
to
t : SD!packagedElement (
name <- 'bla'
)
}

-------------------------------------

Hope that works!
Previous Topic:Obscure error while saving an output model...
Next Topic:OWL2XML wrong output
Goto Forum:
  


Current Time: Sat Nov 11 08:18:13 GMT 2023

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

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

Back to the top