Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] transformation one element in two elements and their arrangement
[ATL] transformation one element in two elements and their arrangement [message #539829] Sun, 13 June 2010 19:07 Go to next message
katja  is currently offline katja
Messages: 18
Registered: March 2010
Junior Member
Hello everybody,

I want to map some structure with ATL, but I can't. Maybe anybody have an idea how can I get this?
What I want is to transform one particular element in two different elements and put one of them into another indirectly.
Here is the example:

entrypoint rule Metamodel() {
to t : uml!Model(
packagedElement <- bpmn!BPool.allInstances()->collect(a | thisModule.r0(a)),
packagedElement <- bpmn!BLane.allInstances() -> collect(a | thisModule.r1(a)) )
do { thisModule.Model <- t; }}

unique lazy rule r0{
from X0 : bpmn!Pool
to Y0 : uml!Collaboration(
ownedAttribute <-X1.Lanes->->collect(a | thisModule.r1(a)) )}

unique lazy rule r1{
from X1 : bpmn!Lane
to Y1 : uml!Class(
ownedBehavior <-X1.Elements->->collect(a | thisModule.r2(a)) )}

unique lazy rule r2{
from X2 : bpmn!Task
to Y2 : uml!Activity(
group <-X2.findPArentPool()->collect(a | thisModule.r3(a)) )}

unique lazy rule r3{
from X3 : bpmn!Pool
to Y3 : uml!ActivityPartition(
subpartition<- X3.Lanes->collect(a | thisModule.r4(a)) )}

unique lazy rule r4{
from X4 : bpmn!Lane
to Y4 : uml!ActivityPartition( )}

I always get the error: An internal error occurred during: "Launching BPMN2SoaML".
org.eclipse.emf.ecore.impl.DynamicEObjectImpl cannot be cast to java.util.Collection.

I have already tried many different solutions, but I can't get such hierarchy as I want.
I use Eclipse 3.4.2, ATL 3.0.1, EMF-specific VM.

Thank you for any help!

Katya
Re: [ATL] transformation one element in two elements and their arrangement [message #539859 is a reply to message #539829] Mon, 14 June 2010 06:58 Go to previous messageGo to next message
Helko Glathe is currently offline Helko Glathe
Messages: 55
Registered: July 2009
Member
Hi,

perhaps the double right arrows in rule r0 and r1 are not correct?

"X1.Elements->->collect(a | thisModule.r2(a))"

Moreover...
"unique lazy rule r0{
from X0 : bpmn!Pool
to Y0 : uml!Collaboration(
ownedAttribute <-X1.Lanes->->collect(a | thisModule.r1(a)) )}"

Should be
ownedAttribute <-X0.Lanes->->collect(a | thisModule.r1(a)) )}"??

BR / Helko

[Updated on: Mon, 14 June 2010 07:01]

Report message to a moderator

Re: [ATL] transformation one element in two elements and their arrangement [message #539944 is a reply to message #539859] Mon, 14 June 2010 11:11 Go to previous messageGo to next message
katja  is currently offline katja
Messages: 18
Registered: March 2010
Junior Member
Oh, I am very sorry, I have mystyped. You are right, ich should be so as you wrote.
But I want to know in general, is there the possibility to transforn with ATL lazy rules one element into two different and save one into another without appearing the nested element in any other place in output file.

Thank you in advance.
Re: [ATL] transformation one element in two elements and their arrangement [message #539950 is a reply to message #539944] Mon, 14 June 2010 11:26 Go to previous messageGo to next message
Helko Glathe is currently offline Helko Glathe
Messages: 55
Registered: July 2009
Member
Could you give a more detailed description according to your example at beginning of this thread?

Regards, Helko
Re: [ATL] transformation one element in two elements and their arrangement [message #540333 is a reply to message #539950] Tue, 15 June 2010 17:22 Go to previous message
katja  is currently offline katja
Messages: 18
Registered: March 2010
Junior Member
Ok, what I want to do is to transform a set of elements in 2 different sets of elements and then nest one of this set into one element of the other set. It is something like a common view of model and another views like a process view, data view and I want to combine them in one document.

My real example is much more longer, but I tried a simple example looking like the example I posted at the beginning (without typing mistakes:) ) and I have the same error.

I want to get tree structure like this:

Model
--->Collaboration (from Pool)
--->Class (from Lane)
------->Activity (from Task)
------------>ActivityPartition (from Pool)
---------------------->ActivityPartition (from Lane)

But If I use the last 2 rules I get this error...

I also tried this example with ATL 2.0.2, Eclipse 3.4.1, regular VM. I get no error, but the output tree looks like this:

Model
--->Collaboration (from Pool)
--->Class (from Lane)
--------->Activity (from Task)
ActivityPartition (from Pool)
--->ActivityPartition (from Lane)

and it is not what I want.

Is it possible to get the structure I want?

Thank you.

[Updated on: Tue, 15 June 2010 17:25]

Report message to a moderator

Previous Topic:[ATL] many target files
Next Topic:XtendParser
Goto Forum:
  


Current Time: Wed Oct 01 16:20:29 GMT 2014

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

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