Home » Modeling » M2T (model-to-text transformation) » Problems with static profiles and package merge with Acceleo 3.5.1 + Eclipse Luna
Problems with static profiles and package merge with Acceleo 3.5.1 + Eclipse Luna [message #1502602] |
Sun, 07 December 2014 15:45  |
Eclipse User |
|
|
|
Hello,
I'm having problems in using package merge and accessing stereotypes in Acceleo 3.5.1 in Eclipse Luna.
In the following I used xxxx in place of http because I have less than 5 messages on the forum and profile uri are detected as external links, sorry.
I have two static profiles (you can find the related plugins in attached file profiles.tar.gz).
The profile xxxx://hwinterface.elt.elt/profile is applied to Model1 (in models.tar.gz).
Model2 (in models.tar.gz) merges model1 and applies the profile xxxx://hwinterface.elt.elt/vhdl/profile.
Model1 contains the sysml Block Register1 on which the stereotype Register is applied.
Model2 contains the sysml Block Register1 on which the stereotype RegisterVHDL is applied.
The transformation org.eclipse.acceleo.module.demo (in transformation.tar.gz) takes Model2 as input.
The file generate.mtl is pretty simple:
[comment encoding = UTF-8 /]
[module generate(... all metamodels here but I cannot post because I have less than 5 messages ... )]
[template public generateElement(model : Model)]
[comment @main/]
[file ('test.txt', false, 'UTF-8')]
[for (cls : Class | model.ownedMember->selectByType(Class))]
Class: [cls.name/]
Stereotypes: [cls.getAppliedStereotypes()/]
Hardware Elements: [HardwareElement.allInstances().base_Class.name/]
RegisterVHDL: [RegisterVHDL.allInstances().base_Class.name/]
[/for]
[/file]
[/template]
Running the transformation I get the following result:
Class: Register1
Stereotypes:
Hardware Elements:
RegisterVHDL: Register1
so the result is that package merge seems not taking place at all.
I don't see any HardwareElement stereotype (HardwareElement generalizes Register) and moreover I don't see model elements that are contained in Model1.
The other problem is that I getAppliedStereotypes() in Acceleo doesn't work anymore.
Thank you in advance,
Francesco
|
|
|
Re: Problems with static profiles and package merge with Acceleo 3.5.1 + Eclipse Luna [message #1503843 is a reply to message #1502602] |
Mon, 08 December 2014 15:54   |
Eclipse User |
|
|
|
Trying to solve the "Package Merge" problem I changed the project this way:
Model1 owns Register1 with Stereotype "Register" from the first profile (hwinterface.elt.elt/profile)
Model2 owns Register1 with Stereotype "RegisterVHDL" from the second profile (hwinterface.elt.elt/vhdl/profile).
Model2 doesn't "Package Merge" anymore "Model1.
Model3 "Package Merges" both Model2 and Model1.
The transformation uses the class org.eclipse.uml2.uml.util.UMLUtil.PackageMerger to perform the merge.
The generate.mtl file became:
[comment encoding = UTF-8 /]
[module generate(--- cannot post, see the file pls --- )]
[query public packageMerge(pkg : Package) : Model =
invoke('org.eclipse.acceleo.module.demo.main.Utilities', 'mergePackages(org.eclipse.uml2.uml.Package)', Sequence{pkg})
/]
[template public generateElement(model : Model)]
[comment @main/]
[file ('test.txt', false, 'UTF-8')]
[generateModel(model.packageMerge())/]
[/file]
[/template]
[template public generateModel(model : Model)]
Other: [model.getOwnedTypes()->sep(',')/]
[let profile : EPackage = model.getAllProfileApplications().getAppliedDefinition()->any(name='HWSWInterface')]
Profile: [profile.eContents()->sep(',')/]
Stereotypes:
[for (cls : EClassifier | profile.eClassifiers)]
Classifier: [cls.name/]
[/for]
[for (cls : Class | model.ownedMember->selectByType(Class))]
======================================================================
Class: [cls.name/] Properties: [cls.attribute.name->sep(',')/]
Stereotypes: [cls.getAppliedStereotypes()/]
Hardware Elements: [HardwareElement.allInstances().base_Class.name->sep(',')/]
[/for]
RegisterVHDL: [RegisterVHDL.allInstances().base_Class.name/]
HardwareElement: [HardwareElement.allInstances()->sep(',')/]
[/let]
[/template]
This time I get the result:
Other: org.eclipse.uml2.uml.internal.impl.ClassImpl@51f49060 (name: BoardSection1, visibility: <unset>) (isLeaf: false, isAbstract: false, isFinalSpecialization: false) (isActive: false),org.eclipse.uml2.uml.internal.impl.ClassImpl@687a762c (name: Block1, visibility: <unset>) (isLeaf: false, isAbstract: false, isFinalSpecialization: false) (isActive: false),org.eclipse.uml2.uml.internal.impl.AssociationImpl@6815c5f2 (name: RegisterInstance1, visibility: <unset>) (isLeaf: false, isAbstract: false, isFinalSpecialization: false) (isDerived: false),org.eclipse.uml2.uml.internal.impl.AssociationImpl@70925b45 (name: <unset>, visibility: <unset>) (isLeaf: false, isAbstract: false, isFinalSpecialization: false) (isDerived: false),org.eclipse.uml2.uml.internal.impl.ClassImpl@410954b (name: Board1, visibility: <unset>) (isLeaf: false, isAbstract: false, isFinalSpecialization: false) (isActive: false),org.eclipse.uml2.uml.internal.impl.ClassImpl@23a9ba52 (name: Register1, visibility: <unset>) (isLeaf: false, isAbstract: false, isFinalSpecialization: false) (isActive: false),org.eclipse.uml2.uml.internal.impl.AssociationImpl@7e1a1da6 (name: BoardSectionInstance1, visibility: <unset>) (isLeaf: false, isAbstract: false, isFinalSpecialization: false) (isDerived: false)
Profile: org.eclipse.emf.ecore.impl.EClassImpl@4879f0f2 (name: BoardSection) (instanceClassName: null) (abstract: false, interface: false),org.eclipse.emf.ecore.impl.EClassImpl@47db5fa5 (name: Group) (instanceClassName: null) (abstract: false, interface: false),org.eclipse.emf.ecore.impl.EClassImpl@354fc8f0 (name: HardwareElement) (instanceClassName: null) (abstract: true, interface: false),org.eclipse.emf.ecore.impl.EClassImpl@40499e4f (name: MemoryRegister) (instanceClassName: null) (abstract: true, interface: false),org.eclipse.emf.ecore.impl.EClassImpl@7a791b66 (name: Field) (instanceClassName: null) (abstract: false, interface: false),org.eclipse.emf.ecore.impl.EClassImpl@4fc5e095 (name: GroupInstance) (instanceClassName: null) (abstract: false, interface: false),org.eclipse.emf.ecore.impl.EClassImpl@435871cb (name: HWElementAssociation) (instanceClassName: null) (abstract: false, interface: false),org.eclipse.emf.ecore.impl.EClassImpl@556d0826 (name: IndirectMemoryAddress) (instanceClassName: null) (abstract: false, interface: false),org.eclipse.emf.ecore.impl.EClassImpl@5bfa8cc5 (name: Board) (instanceClassName: null) (abstract: false, interface: false),org.eclipse.emf.ecore.impl.EClassImpl@efde75f (name: MemoryRegisterInstance) (instanceClassName: null) (abstract: true, interface: false),org.eclipse.emf.ecore.impl.EClassImpl@3b220bcb (name: BoardSectionInstance) (instanceClassName: null) (abstract: false, interface: false),org.eclipse.emf.ecore.impl.EClassImpl@4a3329b9 (name: Register) (instanceClassName: null) (abstract: false, interface: false),org.eclipse.emf.ecore.impl.EClassImpl@160ac7fb (name: MemoryElement) (instanceClassName: null) (abstract: false, interface: false),org.eclipse.emf.ecore.impl.EClassImpl@12bfd80d (name: RegisterInstance) (instanceClassName: null) (abstract: false, interface: false),org.eclipse.emf.ecore.impl.EClassImpl@13e3c1c7 (name: MemoryInstance) (instanceClassName: null) (abstract: false, interface: false),org.eclipse.emf.ecore.impl.EEnumImpl@344344fa (name: enEndianess) (instanceClassName: null) (serializable: true),org.eclipse.emf.ecore.impl.EEnumImpl@2db2cd5 (name: enDataWidth) (instanceClassName: null) (serializable: true),org.eclipse.emf.ecore.impl.EEnumImpl@70e659aa (name: enMemoryType) (instanceClassName: null) (serializable: true),org.eclipse.emf.ecore.impl.EEnumImpl@615f972 (name: enReadMode) (instanceClassName: null) (serializable: true)
Stereotypes:
Classifier: BoardSection
Classifier: Group
Classifier: HardwareElement
Classifier: MemoryRegister
Classifier: Field
Classifier: GroupInstance
Classifier: HWElementAssociation
Classifier: IndirectMemoryAddress
Classifier: Board
Classifier: MemoryRegisterInstance
Classifier: BoardSectionInstance
Classifier: Register
Classifier: MemoryElement
Classifier: RegisterInstance
Classifier: MemoryInstance
Classifier: enEndianess
Classifier: enDataWidth
Classifier: enMemoryType
Classifier: enReadMode
======================================================================
Class: BoardSection1 Properties: board1_1,register1_1
Stereotypes:
Hardware Elements:
======================================================================
Class: Block1 Properties:
Stereotypes:
Hardware Elements:
======================================================================
Class: Board1 Properties: boardsection1_1
Stereotypes:
Hardware Elements:
======================================================================
Class: Register1 Properties: boardsection1_1,block1_1
Stereotypes:
Hardware Elements:
RegisterVHDL:
HardwareElement:
This is a bit better... profiles are applied and the merge is performed but I cannot find stereotypes (maybe I just don't know how to get them...).
I attached the new models and the new transformation (profiles didn't change).
Thank you in advance,
Francesco
|
|
|
Re: Problems with static profiles and package merge with Acceleo 3.5.1 + Eclipse Luna [message #1504842 is a reply to message #1503843] |
Tue, 09 December 2014 11:09   |
Eclipse User |
|
|
|
Hi
Until you get it working, I recommend doing the PackageMerge manually.
Indeed even if it works, I would still recommend using an MWE2 workflow
to sequence your transformation steps.
IIRC PackageMerge has some options which you need to get right.
Practice with Java first before trying to get the same thing to work
with a layer of MtoT abstraction/obfuscation.
Regards
Ed Willik
On 08/12/2014 20:54, Francesco Chirico wrote:
> Trying to solve the "Package Merge" problem I changed the project this way:
> Model1 owns Register1 with Stereotype "Register" from the first profile (hwinterface.elt.elt/profile)
> Model2 owns Register1 with Stereotype "RegisterVHDL" from the second profile (hwinterface.elt.elt/vhdl/profile).
> Model2 doesn't "Package Merge" anymore "Model1.
> Model3 "Package Merges" both Model2 and Model1.
> The transformation uses the class org.eclipse.uml2.uml.util.UMLUtil.PackageMerger to perform the merge.
>
> The generate.mtl file became:
>
> [comment encoding = UTF-8 /]
> [module generate(--- cannot post, see the file pls --- )]
>
>
> [query public packageMerge(pkg : Package) : Model =
> invoke('org.eclipse.acceleo.module.demo.main.Utilities', 'mergePackages(org.eclipse.uml2.uml.Package)', Sequence{pkg})
> /]
>
>
> [template public generateElement(model : Model)]
> [comment @main/]
> [file ('test.txt', false, 'UTF-8')]
> [generateModel(model.packageMerge())/]
> [/file]
> [/template]
>
> [template public generateModel(model : Model)]
> Other: [model.getOwnedTypes()->sep(',')/]
> [let profile : EPackage = model.getAllProfileApplications().getAppliedDefinition()->any(name='HWSWInterface')]
> Profile: [profile.eContents()->sep(',')/]
> Stereotypes:
> [for (cls : EClassifier | profile.eClassifiers)]
> Classifier: [cls.name/]
> [/for]
> [for (cls : Class | model.ownedMember->selectByType(Class))]
> ======================================================================
> Class: [cls.name/] Properties: [cls.attribute.name->sep(',')/]
> Stereotypes: [cls.getAppliedStereotypes()/]
> Hardware Elements: [HardwareElement.allInstances().base_Class.name->sep(',')/]
> [/for]
> RegisterVHDL: [RegisterVHDL.allInstances().base_Class.name/]
> HardwareElement: [HardwareElement.allInstances()->sep(',')/]
> [/let]
> [/template]
>
> This time I get the result:
>
> Other: mailto:org.eclipse.uml2.uml.internal.impl.ClassImpl@51f49060 (name: BoardSection1, visibility: <unset>) (isLeaf: false, isAbstract: false, isFinalSpecialization: false) (isActive: false),mailto:org.eclipse.uml2.uml.internal.impl.ClassImpl@687a762c (name: Block1, visibility: <unset>) (isLeaf: false, isAbstract: false, isFinalSpecialization: false) (isActive: false),mailto:org.eclipse.uml2.uml.internal.impl.AssociationImpl@6815c5f2 (name: RegisterInstance1, visibility: <unset>) (isLeaf: false, isAbstract: false, isFinalSpecialization: false) (isDerived: false),mailto:org.eclipse.uml2.uml.internal.impl.AssociationImpl@70925b45 (name: <unset>, visibility: <unset>) (isLeaf: false, isAbstract: false, isFinalSpecialization: false) (isDerived: false),mailto:org.eclipse.uml2.uml.internal.impl.ClassImpl@410954b (name: Board1, visibility: <unset>) (isLeaf: false, isAbstract: false, isFinalSpecialization: false) (isActive: false),mailto:org.eclipse.uml2.uml.internal.impl.ClassImpl@23a9
ba52 (name: Register1, visibility: <unset>) (isLeaf: false, isAbstract: false, isFinalSpecialization: false) (isActive: false),mailto:org.eclipse.uml2.uml.internal.impl.AssociationImpl@7e1a1da6 (name: BoardSectionInstance1, visibility: <unset>) (isLeaf: false, isAbstract: false, isFinalSpecialization: false) (isDerived: false)
> Profile: mailto:org.eclipse.emf.ecore.impl.EClassImpl@4879f0f2 (name: BoardSection) (instanceClassName: null) (abstract: false, interface: false),mailto:org.eclipse.emf.ecore.impl.EClassImpl@47db5fa5 (name: Group) (instanceClassName: null) (abstract: false, interface: false),mailto:org.eclipse.emf.ecore.impl.EClassImpl@354fc8f0 (name: HardwareElement) (instanceClassName: null) (abstract: true, interface: false),mailto:org.eclipse.emf.ecore.impl.EClassImpl@40499e4f (name: MemoryRegister) (instanceClassName: null) (abstract: true, interface: false),mailto:org.eclipse.emf.ecore.impl.EClassImpl@7a791b66 (name: Field) (instanceClassName: null) (abstract: false, interface: false),mailto:org.eclipse.emf.ecore.impl.EClassImpl@4fc5e095 (name: GroupInstance) (instanceClassName: null) (abstract: false, interface: false),mailto:org.eclipse.emf.ecore.impl.EClassImpl@435871cb (name: HWElementAssociation) (instanceClassName: null) (abstract: false, interface: false),mailto:org.eclipse.emf.ecore.
impl.EClassImpl@556d0826 (name: IndirectMemoryAddress) (instanceClassName: null) (abstract: false, interface: false),mailto:org.eclipse.emf.ecore.impl.EClassImpl@5bfa8cc5 (name: Board) (instanceClassName: null) (abstract: false, interface: false),mailto:org.eclipse.emf.ecore.impl.EClassImpl@efde75f (name: MemoryRegisterInstance) (instanceClassName: null) (abstract: true, interface: false),mailto:org.eclipse.emf.ecore.impl.EClassImpl@3b220bcb (name: BoardSectionInstance) (instanceClassName: null) (abstract: false, interface: false),mailto:org.eclipse.emf.ecore.impl.EClassImpl@4a3329b9 (name: Register) (instanceClassName: null) (abstract: false, interface: false),mailto:org.eclipse.emf.ecore.impl.EClassImpl@160ac7fb (name: MemoryElement) (instanceClassName: null) (abstract: false, interface: false),mailto:org.eclipse.emf.ecore.impl.EClassImpl@12bfd80d (name: RegisterInstance) (instanceClassName: null) (abstract: false, interface: false),mailto:org.eclipse.emf.ecore.impl.EClassImpl@13e3
c1c7 (name: MemoryInstance) (instanceClassName: null) (abstract: false, interface: false),mailto:org.eclipse.emf.ecore.impl.EEnumImpl@344344fa (name: enEndianess) (instanceClassName: null) (serializable: true),mailto:org.eclipse.emf.ecore.impl.EEnumImpl@2db2cd5 (name: enDataWidth) (instanceClassName: null) (serializable: true),mailto:org.eclipse.emf.ecore.impl.EEnumImpl@70e659aa (name: enMemoryType) (instanceClassName: null) (serializable: true),mailto:org.eclipse.emf.ecore.impl.EEnumImpl@615f972 (name: enReadMode) (instanceClassName: null) (serializable: true)
> Stereotypes:
> Classifier: BoardSection
> Classifier: Group
> Classifier: HardwareElement
> Classifier: MemoryRegister
> Classifier: Field
> Classifier: GroupInstance
> Classifier: HWElementAssociation
> Classifier: IndirectMemoryAddress
> Classifier: Board
> Classifier: MemoryRegisterInstance
> Classifier: BoardSectionInstance
> Classifier: Register
> Classifier: MemoryElement
> Classifier: RegisterInstance
> Classifier: MemoryInstance
> Classifier: enEndianess
> Classifier: enDataWidth
> Classifier: enMemoryType
> Classifier: enReadMode
> ======================================================================
> Class: BoardSection1 Properties: board1_1,register1_1
> Stereotypes:
> Hardware Elements:
> ======================================================================
> Class: Block1 Properties:
> Stereotypes:
> Hardware Elements:
> ======================================================================
> Class: Board1 Properties: boardsection1_1
> Stereotypes:
> Hardware Elements:
> ======================================================================
> Class: Register1 Properties: boardsection1_1,block1_1
> Stereotypes:
> Hardware Elements:
> RegisterVHDL:
> HardwareElement:
>
> This is a bit better... profiles are applied and the merge is performed but I cannot find stereotypes (maybe I just don't know how to get them...).
>
> I attached the new models and the new transformation (profiles didn't change).
>
> Thank you in advance,
> Francesco
>
|
|
| | | | | | |
Re: Problems with static profiles and package merge with Acceleo 3.5.1 + Eclipse Luna [message #1509818 is a reply to message #1509660] |
Sat, 13 December 2014 10:09   |
Eclipse User |
|
|
|
Hi Ed,
I tried to simplify the project to understand where is the root of the problem that I'm having.
Concerning stereotypes I tried to create a blank sysml project in Papyrus (I'm using Eclipse Luna).
If I create an acceleo transformation like this:
[comment encoding = UTF-8 /]
[module generate('http://www.eclipse.org/uml2/5.0.0/UML', 'http://www.eclipse.org/papyrus/0.7.0/SysML')]
[template public generateElement(model : Model)]
[comment @main/]
[file ('test.txt', false, 'UTF-8')]
[model.profileApplication.appliedProfile.ownedStereotype/]
Applied Profiles: [model.profileApplication.appliedProfile->sep(',')/]
[for (cls : Class | Class.allInstances())]
getAppliedStereotypes(): [cls.getAppliedStereotypes()->size()/]
getStereotypeApplication():[cls.getStereotypeApplications()->size()/]
[/for]
[/file]
[/template]
I get the following output:
Applied Profiles: org.eclipse.uml2.uml.internal.impl.ProfileImpl@2756c0a7 (eProxyURI: platform:/plugin/elt.elt.hwinterface.profile/models/model.profile.uml#_FK3LcGt0EeSwlPKAc3aoyQ),org.eclipse.uml2.uml.internal.impl.ProfileImpl@15c25153 (eProxyURI: pathmap://SysML_PROFILES/SysML.profile.uml#_fSw28LX7EduFmqQsrNB9lw),org.eclipse.uml2.uml.internal.impl.ProfileImpl@4d098f9b (eProxyURI: pathmap://SysML_PROFILES/SysML.profile.uml#_5WYJ0LX7EduFmqQsrNB9lw),org.eclipse.uml2.uml.internal.impl.ProfileImpl@83298d7 (eProxyURI: pathmap://SysML_PROFILES/SysML.profile.uml#_nAF5kLX8EduFmqQsrNB9lw),org.eclipse.uml2.uml.internal.impl.ProfileImpl@62fad19 (eProxyURI: pathmap://SysML_PROFILES/SysML.profile.uml#_NxdG4LX8EduFmqQsrNB9lw),org.eclipse.uml2.uml.internal.impl.ProfileImpl@55e8ec2f (eProxyURI: pathmap://SysML_PROFILES/SysML.profile.uml#_OOJC4LX8EduFmqQsrNB9lw),org.eclipse.uml2.uml.internal.impl.ProfileImpl@7e3060d8 (eProxyURI: pathmap://SysML_PROFILES/SysML.profile.uml#_C2zXMLX8EduFmqQsrNB9lw),org.eclipse.uml2.uml.internal.impl.ProfileImpl@1433046b (eProxyURI: pathmap://SysML_PROFILES/SysML.profile.uml#_TZ_nULU5EduiKqCzJMWbGw),org.eclipse.uml2.uml.internal.impl.ProfileImpl@6b54655f (eProxyURI: pathmap://SysML_PROFILES/SysML.profile.uml#_neZmMLX8EduFmqQsrNB9lw),org.eclipse.uml2.uml.internal.impl.ProfileImpl@51e8e6e6 (eProxyURI: pathmap://SysML_PROFILES/SysML.profile.uml#_rpx28LX7EduFmqQsrNB9lw),org.eclipse.uml2.uml.internal.impl.ProfileImpl@72445aba (eProxyURI: pathmap://SysML_PROFILES/SysML.profile.uml#_Gx8MgLX7EduFmqQsrNB9lw),org.eclipse.uml2.uml.internal.impl.ProfileImpl@773f7880 (eProxyURI: pathmap://SysML_PROFILES/SysML.profile.uml#_meOioLX8EduFmqQsrNB9lw)
getAppliedStereotypes(): 0
getStereotypeApplication():0
Please notice that both getAppliedStereotypes() and getStereotypeApplication() give back empty sets.
Regards,
Francesco
|
|
|
Re: Problems with static profiles and package merge with Acceleo 3.5.1 + Eclipse Luna [message #1509823 is a reply to message #1509818] |
Sat, 13 December 2014 10:11   |
Eclipse User |
|
|
|
I read somewhere that eProxyURI: is the symptom that a resource is not correctly loaded.
Then I changed the registerPackages method to contain the following code:
Map<URI,URI> uriMap = resourceSet.getURIConverter().getURIMap();
URI sysmlBaseUri=URI.createURI("platform:/plugin/org.eclipse.papyrus.sysml/");
uriMap.put(URI.createURI(SysmlResource.LIBRARIES_PATHMAP), sysmlBaseUri.appendSegment("libraries").appendSegment(""));
uriMap.put(URI.createURI(SysmlResource.PROFILES_PATHMAP), sysmlBaseUri.appendSegment("model").appendSegment(""));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(SysmlPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_TZ_nULU5EduiKqCzJMWbGw"));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(ModelelementsPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_Gx8MgLX7EduFmqQsrNB9lw"));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(BlocksPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_fSw28LX7EduFmqQsrNB9lw"));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(PortandflowsPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_rpx28LX7EduFmqQsrNB9lw"));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(ConstraintsPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_5WYJ0LX7EduFmqQsrNB9lw"));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(ActivitiesPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_C2zXMLX8EduFmqQsrNB9lw"));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(AllocationsPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_NxdG4LX8EduFmqQsrNB9lw"));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(RequirementsPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_OOJC4LX8EduFmqQsrNB9lw"));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(InteractionsPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_meOioLX8EduFmqQsrNB9lw"));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(StatemachinesPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_nAF5kLX8EduFmqQsrNB9lw"));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(UsecasesPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_neZmMLX8EduFmqQsrNB9lw"));
Even in this case I didn't get it right.
Francesco
|
|
|
Re: Problems with static profiles and package merge with Acceleo 3.5.1 + Eclipse Luna [message #1509890 is a reply to message #1509823] |
Sat, 13 December 2014 11:32   |
Eclipse User |
|
|
|
H
I am afraid that I have never used UML with Acceleo let alone
stereotypes. You haven't provided anything to practice on even if I had
time to look at it which I don't since I'm no longer an Acceleo user.
I hope someone else can be more helpful.
Regards
Ed Willink
On 13/12/2014 15:11, Francesco Chirico wrote:
> I read somewhere that eProxyURI: is the symptom that a resource is not
> correctly loaded.
> Then I changed the registerPackages method to contain the following code:
>
> Map<URI,URI> uriMap = resourceSet.getURIConverter().getURIMap();
> URI
> sysmlBaseUri=URI.createURI("platform:/plugin/org.eclipse.papyrus.sysml/");
> uriMap.put(URI.createURI(SysmlResource.LIBRARIES_PATHMAP),
> sysmlBaseUri.appendSegment("libraries").appendSegment(""));
> uriMap.put(URI.createURI(SysmlResource.PROFILES_PATHMAP),
> sysmlBaseUri.appendSegment("model").appendSegment(""));
> UMLPlugin.getEPackageNsURIToProfileLocationMap().put(SysmlPackage.eNS_URI,
>
> URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_TZ_nULU5EduiKqCzJMWbGw"));
>
>
> UMLPlugin.getEPackageNsURIToProfileLocationMap().put(ModelelementsPackage.eNS_URI,
>
> URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_Gx8MgLX7EduFmqQsrNB9lw"));
>
>
> UMLPlugin.getEPackageNsURIToProfileLocationMap().put(BlocksPackage.eNS_URI,
>
> URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_fSw28LX7EduFmqQsrNB9lw"));
>
> UMLPlugin.getEPackageNsURIToProfileLocationMap().put(PortandflowsPackage.eNS_URI,
>
> URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_rpx28LX7EduFmqQsrNB9lw"));
>
>
> UMLPlugin.getEPackageNsURIToProfileLocationMap().put(ConstraintsPackage.eNS_URI,
>
> URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_5WYJ0LX7EduFmqQsrNB9lw"));
>
>
> UMLPlugin.getEPackageNsURIToProfileLocationMap().put(ActivitiesPackage.eNS_URI,
>
> URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_C2zXMLX8EduFmqQsrNB9lw"));
>
>
> UMLPlugin.getEPackageNsURIToProfileLocationMap().put(AllocationsPackage.eNS_URI,
>
> URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_NxdG4LX8EduFmqQsrNB9lw"));
>
>
> UMLPlugin.getEPackageNsURIToProfileLocationMap().put(RequirementsPackage.eNS_URI,
>
> URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_OOJC4LX8EduFmqQsrNB9lw"));
>
>
> UMLPlugin.getEPackageNsURIToProfileLocationMap().put(InteractionsPackage.eNS_URI,
>
> URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_meOioLX8EduFmqQsrNB9lw"));
>
>
> UMLPlugin.getEPackageNsURIToProfileLocationMap().put(StatemachinesPackage.eNS_URI,
>
> URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_nAF5kLX8EduFmqQsrNB9lw"));
>
>
> UMLPlugin.getEPackageNsURIToProfileLocationMap().put(UsecasesPackage.eNS_URI,
>
> URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_neZmMLX8EduFmqQsrNB9lw"));
>
> Even in this case I didn't get it right.
>
> Francesco
|
|
|
Re: Problems with static profiles and package merge with Acceleo 3.5.1 + Eclipse Luna [message #1521540 is a reply to message #1509890] |
Sun, 21 December 2014 16:57  |
Eclipse User |
|
|
|
I finally found a solution and I wanted to share it with everybody.
It seems that the problem is related to the fact that I can't use the Acceleo Plug-in Runner and must use the Java Runner in Eclipse Luna.
The result is that many initializations must be performed by hand.
I had to change the method registerResourceFactories as follows:
super.registerResourceFactories(resourceSet);
if (!EMFPlugin.IS_ECLIPSE_RUNNING) {
projectMap.initializeResourceSet(resourceSet);
}
where projectMap is inizialized as follows:
private static ProjectMap projectMap = new ProjectMap();
ProjectMap is imported from org.eclipse.ocl.examples.domain.utilities.ProjectMap.
I also added to registerPackages the following lines:
Map<URI,URI> uriMap = resourceSet.getURIConverter().getURIMap();
URI sysmlBaseUri=URI.createURI("platform:/plugin/org.eclipse.papyrus.sysml");
uriMap.put(URI.createURI(SysmlResource.LIBRARIES_PATHMAP), sysmlBaseUri.appendSegment("libraries").appendSegment(""));
uriMap.put(URI.createURI(SysmlResource.PROFILES_PATHMAP), sysmlBaseUri.appendSegment("model").appendSegment(""));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(SysmlPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_TZ_nULU5EduiKqCzJMWbGw"));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(ModelelementsPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_Gx8MgLX7EduFmqQsrNB9lw"));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(BlocksPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_fSw28LX7EduFmqQsrNB9lw"));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(PortandflowsPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_rpx28LX7EduFmqQsrNB9lw"));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(ConstraintsPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_5WYJ0LX7EduFmqQsrNB9lw"));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(ActivitiesPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_C2zXMLX8EduFmqQsrNB9lw"));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(AllocationsPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_NxdG4LX8EduFmqQsrNB9lw"));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(RequirementsPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_OOJC4LX8EduFmqQsrNB9lw"));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(InteractionsPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_meOioLX8EduFmqQsrNB9lw"));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(StatemachinesPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_nAF5kLX8EduFmqQsrNB9lw"));
UMLPlugin.getEPackageNsURIToProfileLocationMap().put(UsecasesPackage.eNS_URI,
URI.createURI(SysmlResource.SYSML_PROFILE_URI+"#_neZmMLX8EduFmqQsrNB9lw"));
Bye,
Francesco
|
|
|
Goto Forum:
Current Time: Fri Apr 25 07:22:35 EDT 2025
Powered by FUDForum. Page generated in 0.03645 seconds
|