Home » Modeling » ATL » NoSuchElementException when appending refining trace to sequence
NoSuchElementException when appending refining trace to sequence [message #989204] |
Wed, 05 December 2012 08:47 |
Andreas Brieg Messages: 48 Registered: November 2012 |
Member |
|
|
I have an ecore model where a lot of classes have 3 attributes for audit information. I want to replace these 3 attributes with a reference to a class that contains all those attributes. That class is contained in another ecore model.
Therefore I wrote the following transformation:
-- @atlcompiler atl2010
-- @nsURI ECore=http://www.eclipse.org/emf/2002/Ecore
module refactorAuditInfo;
create output: ECore refining input: ECore, additional: ECore;
rule addReferenceToAudit {
from
input : ECore!EClass (
input.eStructuralFeatures -> exists(e | e.isAuditInfoFeature())
)
to
auditInfoReference : ECore!EReference (
eContainingClass <- input,
eType <- input.refImmediateComposite().auditClassifier(),
name <- 'audit',
eReferenceType <- input.refImmediateComposite().auditClassifier().debug()
),
outputClass : ECore!EClass (
eStructuralFeatures <- input.eStructuralFeatures.append(auditInfoReference.debug())
)
}
helper context ECore!EPackage def : auditClassifier() : OclAny =
thisModule.additionalDbadm.eClassifiers -> select(e | e.name = 'Audit').first();
helper def : additionalDbadm : ECore!EPackage =
ECore!EPackage.allInstances()->select(e | e.nsURI = 'http://additional.dbadm/1.0').first();
helper context ECore!EStructuralFeature def : isAuditInfoFeature() : Boolean =
Sequence{'beDat', 'beUser', 'beRolle'}.contains(self.name);
However I get a NoSuchElementException when I execute that transformation. The output is:
additional!Audit
refiningTrace!<unnamed>
org.eclipse.m2m.atl.engine.emfvm.VMException
at __resolve__#13(refactorAuditInfo.atl)
local variables: self=refactorAuditInfo : ASMModule, value=input!beDat
at __resolve__#26(refactorAuditInfo.atl)
local variables: self=refactorAuditInfo : ASMModule, value=Sequence {input!***, input!***, input!***, input!***, input!***, input!***, input!***, input!***, input!***, input!***, input!***, input!***, refiningTrace!<unnamed>}, e=input!beDat
at __applyaddReferenceToAudit#56(refactorAuditInfo.atl[30:7-30:90])
local variables: self=refactorAuditInfo : ASMModule, link=TransientLink {rule = addReferenceToAudit, sourceElements = {input = org.eclipse.emf.ecore.impl.EClassImpl@209933c3 (name: ***) (instanceClassName: null) (abstract: false, interface: false)}, targetElements = {auditInfoReference = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@483d42d (eClass: org.eclipse.emf.ecore.impl.EClassImpl@56cb4b5d (name: Element) (instanceClassName: null) (abstract: false, interface: false)), outputClass = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@6aded8ab (eClass: org.eclipse.emf.ecore.impl.EClassImpl@56cb4b5d (name: Element) (instanceClassName: null) (abstract: false, interface: false))}, variables = {}}, input=input!***, auditInfoReference=refiningTrace!<unnamed>, outputClass=refiningTrace!<unnamed>
at __exec__#18(refactorAuditInfo.atl)
local variables: self=refactorAuditInfo : ASMModule, e=TransientLink {rule = addReferenceToAudit, sourceElements = {input = org.eclipse.emf.ecore.impl.EClassImpl@209933c3 (name: ***) (instanceClassName: null) (abstract: false, interface: false)}, targetElements = {auditInfoReference = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@483d42d (eClass: org.eclipse.emf.ecore.impl.EClassImpl@56cb4b5d (name: Element) (instanceClassName: null) (abstract: false, interface: false)), outputClass = org.eclipse.emf.ecore.impl.DynamicEObjectImpl@6aded8ab (eClass: org.eclipse.emf.ecore.impl.EClassImpl@56cb4b5d (name: Element) (instanceClassName: null) (abstract: false, interface: false))}, variables = {}}
at main#57(refactorAuditInfo.atl)
local variables: self=refactorAuditInfo : ASMModule
Java Stack:
org.eclipse.m2m.atl.engine.emfvm.VMException
at org.eclipse.m2m.atl.engine.emfvm.ASMOperation.exec(ASMOperation.java:643)
at org.eclipse.m2m.atl.engine.emfvm.ASMOperation.exec(ASMOperation.java:388)
at org.eclipse.m2m.atl.engine.emfvm.ASMOperation.exec(ASMOperation.java:388)
at org.eclipse.m2m.atl.engine.emfvm.ASMOperation.exec(ASMOperation.java:388)
at org.eclipse.m2m.atl.engine.emfvm.ASMOperation.exec(ASMOperation.java:388)
at org.eclipse.m2m.atl.engine.emfvm.ASM.run(ASM.java:208)
at org.eclipse.m2m.atl.engine.emfvm.launch.EMFVMLauncher.internalLaunch(EMFVMLauncher.java:170)
at org.eclipse.m2m.atl.engine.emfvm.launch.EMFVMUILauncher.launch(EMFVMUILauncher.java:46)
at org.eclipse.m2m.atl.core.service.LauncherService.launch(LauncherService.java:136)
at org.eclipse.m2m.atl.core.ui.launch.AtlLaunchConfigurationDelegate.launchOrDebug(AtlLaunchConfigurationDelegate.java:300)
at org.eclipse.m2m.atl.core.ui.launch.AtlLaunchConfigurationDelegate.launch(AtlLaunchConfigurationDelegate.java:234)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:855)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:704)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:1047)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1251)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.util.NoSuchElementException
at java.util.ArrayList$Itr.next(Unknown Source)
at org.eclipse.m2m.atl.engine.emfvm.lib.ExecEnv$173.exec(ExecEnv.java:1683)
at org.eclipse.m2m.atl.engine.emfvm.ASMOperation.exec(ASMOperation.java:391)
... 15 more
The NoSuchElementException is raised during execution of the line
eStructuralFeatures <- input.eStructuralFeatures.append(auditInfoReference.debug())
Note that the line information of the ATL stack is not matching the correct line in the above ATL transformation, because I left out some other stuff.
I'm using Juno with ATL 3.3.1. Does anyone know, why this exception is raised and what I'm doing wrong? Thanks
[Updated on: Wed, 05 December 2012 08:49] Report message to a moderator
|
|
| | | | |
Goto Forum:
Current Time: Fri Sep 20 08:23:16 GMT 2024
Powered by FUDForum. Page generated in 0.04137 seconds
|