Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] xmi::id for elements refereced by diagram
[ATL] xmi::id for elements refereced by diagram [message #69483] Thu, 13 December 2007 15:44 Go to next message
Eclipse UserFriend
Originally posted by: bordinmatteo.yahoo.it

This is a multi-part message in MIME format.
--------------080106090400020205070307
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi all,

I am facing this problem: I have a model whose elements are referenced
by a diagram: diagram elements refer model elements by their xmi::id.

I want to transform the model with ATL and still have the output model
to contain valid references for the diagram. The original model may well
be overwritten by the newly generated model.

The first solution that comes to my mind is to modify the xmi::id of the
output - but I am not sure it is possible (and I can just read but not
write using element.__xmiID__ ).

Could anyone please help?

Thank you in advance,

Matteo


--------------080106090400020205070307
Content-Type: text/x-vcard; charset=utf-8;
name="bordinmatteo.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="bordinmatteo.vcf"

begin:vcard
fn:Matteo Bordin
n:Bordin;Matteo
org:University of Padua
email;internet:bordinmatteo@yahoo.it
note:The ASSERT research project
url:http://www.math.unipd.it/~mbordin
version:2.1
end:vcard


--------------080106090400020205070307--
Re: [ATL] xmi::id for elements refereced by diagram [message #69506 is a reply to message #69483] Thu, 13 December 2007 17:50 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hello,

> I am facing this problem: I have a model whose elements are referenced
> by a diagram: diagram elements refer model elements by their xmi::id.
>
> I want to transform the model with ATL and still have the output model
> to contain valid references for the diagram. The original model may well
> be overwritten by the newly generated model.
>
> The first solution that comes to my mind is to modify the xmi::id of the
> output - but I am not sure it is possible (and I can just read but not
> write using element.__xmiID__ ).

I am not sure to fully understand your question, but if you use
inter-resource references, did you try to simply initialize the property
"normally"?

For instance:

rule R {
from
s : MM1!A
to
t : MM2!B (
elementInOtherModel <- s.elementInOtherModel
)
}

If you make sure that the other model can be automatically loaded by EMF
(e.g., retrieved as a relative path to the URI of your source model).


Regards,

Frédéric Jouault
Re: [ATL] xmi::id for elements refereced by diagram [message #69765 is a reply to message #69506] Mon, 17 December 2007 10:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bordinmatteo.yahoo.it

This is a multi-part message in MIME format.
--------------000507050805020701080105
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Fr
Re: [ATL] xmi::id for elements refereced by diagram [message #69949 is a reply to message #69765] Tue, 18 December 2007 20:46 Go to previous messageGo to next message
Frédéric Jouault is currently offline Frédéric JouaultFriend
Messages: 572
Registered: July 2009
Senior Member
Hi Matteo,

I now better understand your problem, thanks for the precision.

You mentioned __xmiID__ in your original message. This is one possible
solution. However setting of __xmiID__ is only supported in the EMF
driver for the moment. Not for the UML2 driver.

If your transformation does not use "non-EMF" features of UML2 (i.e.,
profiles) then you can probably use the EMF driver.


Note, however, using __xmiID__ is not a very high-level solution. If
your transformation only performs some minor refactorings on the model,
then you should consider using refining mode (only available in ATL 2004
so far).


Regards,

Frédéric Jouault


Matteo Bordin wrote:
> Frédéric Jouault wrote:
>> Hello,
>>
>> > I am facing this problem: I have a model whose elements are referenced
>> > by a diagram: diagram elements refer model elements by their xmi::id.
>> >
>> > I want to transform the model with ATL and still have the output model
>> > to contain valid references for the diagram. The original model may
>> well
>> > be overwritten by the newly generated model.
>> >
>> > The first solution that comes to my mind is to modify the xmi::id
>> of the
>> > output - but I am not sure it is possible (and I can just read but
>> not
>> > write using element.__xmiID__ ).
>>
>> I am not sure to fully understand your question, but if you use
>> inter-resource references, did you try to simply initialize the
>> property "normally"?
>>
>> For instance:
>>
>> rule R {
>> from
>> s : MM1!A
>> to
>> t : MM2!B (
>> elementInOtherModel <- s.elementInOtherModel
>> )
>> }
>>
>> If you make sure that the other model can be automatically loaded by
>> EMF (e.g., retrieved as a relative path to the URI of your source model).
>>
>>
>> Regards,
>>
>> Frédéric Jouault
>
> Dear Frederic,
>
> thanks for your reply, but it doesn't solve my problem. I will try to
> explain my self better:
> - I have a UML2 model + diagram designed with TOPCASED/Papyrus/etc.
> - I want to perform an ATL model transformation, overwrite the original
> model with the output of the transformation and still have the diagrams
> to correctly reference the new model.
>
> One possibly seems to be using AMW, have a AMW as model handler (instead
> of EMF), and use setElementIDbyRefType and similar in the ATL
> transformation. However, the results I get don't seem consistent (the
> xmi::id is not always copied) and I wondered if there was another way to
> achieve the same result.
>
> Thanks again,
>
> Matteo
>
>
Re: [ATL] xmi::id for elements refereced by diagram [message #70107 is a reply to message #69949] Fri, 21 December 2007 08:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bordinmatteo.yahoo.it

This is a multi-part message in MIME format.
--------------020406040707060005040505
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hi Frederic,

unfortunately I use ATL on a UML2 profile (SysML/MARTE) - and the
transformation and I expect it to grow up quite complex in the future.

Anyway, trying refining mode gives this error
(even with -- @atlcompiler atl2004):

****** BEGIN Stack Trace
message: feature feature is not changeable
A.main() : ??#24 null
local variables = {self=changeName : ASMModule}
local stack = []
A.__exec__() : ??#8 null
local variables = {e=TransientLink {rule =
'PackageImport2PackageImport', sourceElements = {i1 = IN!<unnamed>},
targetElements = {i2 = OUT!<unnamed>}, variables = {}}, self=changeName
: ASMModule}
local stack = []
A.__applyPackageImport2PackageImport(1 : NTransientLink;) : ??#13 8:17-8:54
local variables = {i2=OUT!<unnamed>, i1=IN!<unnamed>,
link=TransientLink {rule = 'PackageImport2PackageImport', sourceElements
= {i1 = IN!<unnamed>}, targetElements = {i2 = OUT!<unnamed>}, variables
= {}}, self=changeName : ASMModule}
local stack = [OUT!<unnamed>, OUT!<unnamed>]
A.__resolve__(1 : J) : ??#19 null
local variables = {value=IN!UMLPrimitiveTypes, self=changeName : ASMModule}
local stack = []
A.__refiningCopy(1 : J, 2 : B) : ??#115 null
local variables = {isEMF=true, recurseCopy=false,
value=IN!UMLPrimitiveTypes, self=changeName : ASMModule, setValue=true,
targetFeature=UML2!ownedType, ref='EReference', attr='EAttribute'}
local stack = [OUT!<notnamedyet>, OUT!<notnamedyet>, OUT!<notnamedyet>,
'ownedType']
A.__resolve__(1 : J) : ??#29 null
local variables = {e=IN!Boolean, value=Sequence {IN!Boolean,
IN!Integer, IN!String, IN!UnlimitedNatural}, self=changeName : ASMModule}
local stack = [Sequence {}]
A.__resolve__(1 : J) : ??#19 null
local variables = {value=IN!Boolean, self=changeName : ASMModule}
local stack = []
A.__refiningCopy(1 : J, 2 : B) : ??#137 null
local variables = {isEMF=true, recurseCopy=false, value=IN!Boolean,
self=changeName : ASMModule, setValue=true, targetFeature=UML2!feature,
ref='EReference', attr='EAttribute'}
local stack = [OUT!<notnamedyet>, OUT!<notnamedyet>, OUT!<notnamedyet>,
OUT!<notnamedyet>, OUT!<notnamedyet>, OUT!<notnamedyet>]
NativeOperation public static
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny
org.eclipse.m2m.atl.engine.vm.nativelib.ASMOclAny.refSetValu e(org.eclipse.m2m.atl.engine.vm.StackFrame,org.eclipse.m2m.a tl.engine.vm.nativelib.ASMOclAny,org.eclipse.m2m.atl.engine. vm.nativelib.ASMString,org.eclipse.m2m.atl.engine.vm.nativel ib.ASMOclAny)
args = [OUT!<notnamedyet>, 'feature', Sequence {}]
****** END Stack Trace
Execution terminated due to error (see launch configuration to allow
continuation after errors).


Is using the AMW handler the only solutions to my problem (which I admit
I still have to try it)?

Thanks again,

Matteo


Fr
Re: [ATL] xmi::id for elements refereced by diagram [message #75292 is a reply to message #69483] Sat, 23 February 2008 01:33 Go to previous message
Eclipse UserFriend
Originally posted by: zhuj.in.tum.de

Hi Matteo,

I'm having the same problem. Did you find a way to solve the problem?

greetings.
Jinhui
Previous Topic:[ATL] Basic Example -- Tree2List : Bug with "uses Lib4MMTree"
Next Topic:[ATL] same source element(s) in two bindings: why the binding order matters?
Goto Forum:
  


Current Time: Sun Aug 18 10:50:18 GMT 2019

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

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

Back to the top