| model merging [message #1007653] |
Wed, 06 February 2013 16:45  |
Claudio Persico Messages: 24 Registered: November 2012 |
Junior Member |
|
|
Hi to everyone,
I'm trying to merge two UML models in ATL:
Model1:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:VaProfile="http:///schemas/VaProfile/_NoMJ4Gx_EeK4SYm4A9jwEQ/86" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" xsi:schemaLocation="http:///schemas/VaProfile/_NoMJ4Gx_EeK4SYm4A9jwEQ/86 ../VAMProfileCopy/psprofile.profile.uml#_Noz08Gx_EeK4SYm4A9jwEQ">
<uml:Model xmi:id="_riNzQGSgEeKEuaD-A95eUA" name="localeUML2">
<packageImport xmi:id="_riNzQWSgEeKEuaD-A95eUA">
<importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
</packageImport>
<packagedElement xmi:type="uml:Class" xmi:id="_Heyy4GShEeKEuaD-A95eUA" name="Room">
<nestedClassifier xmi:type="uml:Class" xmi:id="_Vf7LUGShEeKEuaD-A95eUA" name="Pillar1"/>
<nestedClassifier xmi:type="uml:Class" xmi:id="_V7Y_UGShEeKEuaD-A95eUA" name="Pillar2"/>
<nestedClassifier xmi:type="uml:Class" xmi:id="_WYjccGShEeKEuaD-A95eUA" name="Server">
<nestedClassifier xmi:type="uml:Class" xmi:id="_LVSGcGk6EeKqn4ij9uqv2g" name="HardDisk"/>
</nestedClassifier>
</packagedElement>
<profileApplication xmi:id="_riNzQmSgEeKEuaD-A95eUA">
<eAnnotations xmi:id="_riNzQ2SgEeKEuaD-A95eUA" source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage" href="http://www.eclipse.org/uml2/schemas/Standard/1#/"/>
</eAnnotations>
<appliedProfile href="pathmap://UML_PROFILES/Standard.profile.uml#_0"/>
</profileApplication>
<profileApplication xmi:id="_zAZcEGSgEeKEuaD-A95eUA">
<eAnnotations xmi:id="_zAdtgGSgEeKEuaD-A95eUA" source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage" href="../VAMProfileCopy/psprofile.profile.uml#_Noz08Gx_EeK4SYm4A9jwEQ"/>
</eAnnotations>
<appliedProfile href="../VAMProfileCopy/psprofile.profile.uml#_g3R-UCp7EeK9bM-qugGxvg"/>
</profileApplication>
</uml:Model>
<VaProfile:Object xmi:id="_ZeXr8GSjEeKEuaD-A95eUA" base_Classifier="_Vf7LUGShEeKEuaD-A95eUA" location="_fZfmkGSjEeKEuaD-A95eUA"/>
<VaProfile:Object xmi:id="_beLnkGSjEeKEuaD-A95eUA" base_Classifier="_V7Y_UGShEeKEuaD-A95eUA" location="_fZfmkGSjEeKEuaD-A95eUA"/>
<VaProfile:Object xmi:id="_c5Ll8GSjEeKEuaD-A95eUA" base_Classifier="_WYjccGShEeKEuaD-A95eUA" location="_fZfmkGSjEeKEuaD-A95eUA"/>
<VaProfile:Site xmi:id="_fZfmkGSjEeKEuaD-A95eUA" base_Classifier="_Heyy4GShEeKEuaD-A95eUA"/>
<VaProfile:Object xmi:id="_TkduYGk6EeKqn4ij9uqv2g" base_Classifier="_LVSGcGk6EeKqn4ij9uqv2g" location="_fZfmkGSjEeKEuaD-A95eUA"/>
</xmi:XMI>
and Model2:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:VaProfile="http:///schemas/VaProfile/_NoMJ4Gx_EeK4SYm4A9jwEQ/86" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" xsi:schemaLocation="http:///schemas/VaProfile/_NoMJ4Gx_EeK4SYm4A9jwEQ/86 ../VAMProfileCopy/psprofile.profile.uml#_Noz08Gx_EeK4SYm4A9jwEQ">
<uml:Model xmi:id="_IkOT4HBoEeKcgp_s5TSrqg" name="protections">
<packagedElement xmi:type="uml:Class" xmi:id="_IkOT4XBoEeKcgp_s5TSrqg" name="_OB0ToGSkEeKEuaD-A95eUA"/>
<packagedElement xmi:type="uml:Class" xmi:id="_IkOT5HBoEeKcgp_s5TSrqg" name="_PQeYsGpCEeK6StkFpCf91Q"/>
<profileApplication xmi:id="_IkOT5XBoEeKcgp_s5TSrqg">
<eAnnotations xmi:id="_IkOT5nBoEeKcgp_s5TSrqg" source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage" href="../VAMProfileCopy/psprofile.profile.uml#_Noz08Gx_EeK4SYm4A9jwEQ"/>
</eAnnotations>
<appliedProfile href="../VAMProfileCopy/psprofile.profile.uml#_g3R-UCp7EeK9bM-qugGxvg"/>
</profileApplication>
</uml:Model>
<VaProfile:Sensor xmi:id="_IkOT53BoEeKcgp_s5TSrqg" base_Classifier="_IkOT4XBoEeKcgp_s5TSrqg" cost="100.0"/>
<VaProfile:Sensor xmi:id="_IkOT6HBoEeKcgp_s5TSrqg" base_Classifier="_IkOT5HBoEeKcgp_s5TSrqg" cost="200.0"/>
</xmi:XMI>
More precisely I'm trying to pickup all classes and stereotypes from model2 and put them into model1.
At first I tried to figure it out with a refinement approach but I faced the problem to use the resolveTemp in an action block, but action blocks are forbidden in refinement mode.
Then I tryied a copy approach, generating all the elements needed and assigning them the values properly, but I faced a problem when managing nested elements.
I read this post http://www.eclipse.org/forums/index.php/m/989963/
where I noticed this sentence:
"In ATL, you can set references between elements from different models as long as these references are not containment references."
Than I'm a bit stuck and I don't know if my problam as a solution or I'm not able to find out one.
I don't know which approach follow and how to do.
I hope you can help me,
Claudio
|
|
|