Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Strange sequence setting in distinct foreach block
[ATL] Strange sequence setting in distinct foreach block [message #665944] Mon, 18 April 2011 09:45 Go to next message
Cedric Gava is currently offline Cedric Gava
Messages: 41
Registered: July 2009
Member
Dear all

I need to duplicate outgoing transitions of a composite state for each simple state inside it.
After some tries, I have to use a distinct/foreach block (I can't use lazy block for this part)...
For copying triggers of theses transitions, I use a Lazy rule (see below trigger <- outTrans.trigger->collect(tr | thisModule.Trigger(tr)) )....

the problem is : the statement given above returns a Sequence of Triggers (thats what I wanted), but, in the target model, only one trigger appears belonging to the transition... the others are attached to the root of the model...

Somebody know what do I miss ?
Is there a problem calling a lazy rule inside a distinct block ?

Thanks for your help
Kind regards
Cedric

lazy rule Trigger {
    from s : UML!"uml::Trigger" 
    to t : UML!"uml::Trigger" (
        name <- s.name,
        visibility <- s.visibility,
        eAnnotations <- s.eAnnotations,
        ownedComment <- s.ownedComment,
        clientDependency <- s.clientDependency,
        nameExpression <- s.nameExpression,
        event <- s.event,
        port <- s.port)
}


rule StateSimpleInsideLeaf extends State {
    from s : UML!State (Condition[...])
    to t : UML!State (
    	name <- s.name,
    	outgoing <- s.outgoing->union(outgoingLeafTransition)->flatten()->excluding(OclUndefined)
		
    ),
	outgoingLeafTransition : distinct UML!Transition foreach(outTrans in s.getContainingLeafState().outgoing)(
		name <- (outTrans.name + '_from' + s.name),
		target <- outTrans.target,
		source <- s,
        trigger <- outTrans.trigger->collect(tr | thisModule.Trigger(tr))					               
								   
	)
}


sooo lonely friends of eclipse on forum
http://www.eclipse.org/donate/images/friendslogo160.jpg
Re: [ATL] Strange sequence setting in distinct foreach block [message #667164 is a reply to message #665944] Wed, 27 April 2011 07:47 Go to previous message
Cedric Gava is currently offline Cedric Gava
Messages: 41
Registered: July 2009
Member
Nobody is in for this problem ?

sooo lonely friends of eclipse on forum
http://www.eclipse.org/donate/images/friendslogo160.jpg
Previous Topic:[ATL] Problem when a uml profile defined several times
Next Topic:adding to containment features with eSet
Goto Forum:
  


Current Time: Sat Sep 20 12:11:55 GMT 2014

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

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