[ATL] Strange sequence setting in distinct foreach block [message #665944] |
Mon, 18 April 2011 09:45 |
Cedric Gava Messages: 53 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
|
|
|
|
Powered by
FUDForum. Page generated in 0.03357 seconds