Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Copy sequences in Refining Mode
[ATL] Copy sequences in Refining Mode [message #854962] Tue, 24 April 2012 11:51
st oehm is currently offline st oehmFriend
Messages: 79
Registered: October 2009
Member
Greetings,

I am using the ATL Refining Mode for refactoring operations on UML Class Diagrams.

For one operation, I would need to copy a sequence several times. Unluckily, the Refining Mode doesn't support lazy rules (yet). Consequently, I need another approach.

I tried it with a helper, where I define a new variable 'seqCopy' which should copy the original sequence and be returned by the helper (see code below - UML2 is the meta-model, Operation the context element on which the helper is invoked and the sequence consists of several Parameters).

helper context UML2!Operation def : copyParameterSequence(seq : Sequence(UML2!Parameter)) : Sequence(UML2!Parameter) =
	let seqCopy: Sequence(UML2!Parameter) = seq->select(p | not p.oclIsUndefined()) in seqCopy;


Unfortunately, this fails. Either no copy is created, or the references from the Parameters are redirected from the original to the new sequence (I guess this is the case). Anyway, I am not getting several sequences.

I also tried several OCL sequence data type operations, namely append, prepend, excluding and including. Help says, these operations return a copy of self with some other modification depending on the actual operation.

Let's say, I use 'excluding':

rule someRule {
   from
    someOperation: UML2!Operation (
        ...
    )
   
   to
    ...,
    newOperation: UML2!Operation (
         ...,
         ownedParameter <- someOperation.ownedParameter.excluding(OclUndefined),
         ...
    )
}


I thought, this might result in having a copy of the Parameters of the original Operation in the newly created Operation (according to the help text, it should). But again, if the transformation is executed it looks like some references are redirected from the old to the new Operation.

Does anyone have another idea how to copy sequences? Please keep in mind that I have to use the Refining Mode, so using lazy rules is not an option.

Thank you and best regards,
stoehm
Previous Topic:ATL from XMI files
Next Topic:[QVTO] advice needed for large models
Goto Forum:
  


Current Time: Fri Nov 28 04:47:37 GMT 2014

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

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