Cross-references in EMFTVM VM standalone [message #1745944] |
Wed, 19 October 2016 13:14  |
Eclipse User |
|
|
|
Hi,
I am running an ATL transformation from Java inside an Eclipse plug-in using the EMFTVM VM.
As input models I have several models with cross references as it is shown in the last line
of this code:
<allocation:Allocation xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"xmlns:allocation="http://sdq.ipd.uka.de/PalladioComponentModel/Allocation/5.0" id="_JiPBICHdEd6lJo4DCALHMw" entityName="defaultAllocation">
<targetResourceEnvironment_Allocation href="My.resourceenvironment#/"/>
<system_Allocation href="default.system#_84D0kCHcEd6lJo4DCALHMw"/>
<allocationContexts_Allocation id="_KCkHACHdEd6lJo4DCALHMw" entityName="Allocation_Assembly_AComponent <AComponent> <AComponent>">
<resourceContainer_AllocationContext href="My.resourceenvironment#_B0aZ0CHdEd6lJo4DCALHMw"/>
...
(note the last line how the attribute is set by a proxy to another file in the same path)
When I run this transformation using the "Run Configuration" in Eclipse, it works fine. However when I triggered the transformation for the same inputs from Java, it fails. The error it throws is the one shown when the proxies/cross-references are not resolved:
org.eclipse.m2m.atl.emftvm.util.VMException: java.lang.ClassCastException: The value of type 'org.eclipse.emf.ecore.impl.EClassImpl@bf33f92 (name: BasicComponent) (instanceClassName: null) (abstract: false, interface: false)' must be of type 'org.eclipse.emf.ecore.impl.EClassImpl@3ab1a290 (name: PCMrepositoryRepositoryComponent) (instanceClassName: null) (abstract: true, interface: false)'
at rule FlattenAssemblyContext@postApply#4(platform:/plugin/es.uma.lcc.e-motions/transformations/MM2FlattenMM.atl#[373:4-373:109])
Local variables: [__trace__: TRACE!TraceLink = 3d52cf4:TRACE!TraceLink, sourceClass: PCM!AssemblyContext = _9c3KwCHcEd6lJo4DCALHMw:PCM!AssemblyContext, targetClass: FlattenPCM!PCMcompositionAssemblyContext = _9c3KwCHcEd6lJo4DCALHMw:FlattenPCM!PCMcompositionAssemblyContext]
at static EMFTVM!ExecEnv::main() : Object(platform:/plugin/es.uma.lcc.e-motions/transformations/MM2FlattenMM.atl)
I am loading the models as follows:
Model inPrimitiveTypes = EmftvmFactory.eINSTANCE.createModel();
inPrimitiveTypes.setResource(rs.getResource(URI.createFileURI(fileManager.getNewPalladioRepository().getFullPath().toOSString()), true));
env.registerInputModel("INPRIMITIVETYPES", inPrimitiveTypes);
...
EcoreUtil.resolveAll(rs);
Where "fileManager.getNewPalladioRepository()" is an "IFile" and all the input models are in the same folder, as they are if they are run using the Run Configuration.
Also I am doing the "resolveAll"... just in case.
Any hint?
Full code is here:
https://github.com/e-motions/e-motions_plugin/blob/master/e-motions_plugin/src/es/uma/lcc/e_motions/jobs/PalladioJob.java#L95
Thank you very much in advance.
[Updated on: Thu, 27 October 2016 10:48] by Moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05247 seconds