Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » 'Undefined argument' exception using Acceleo query from Sirius
'Undefined argument' exception using Acceleo query from Sirius [message #1455656] Wed, 29 October 2014 16:00 Go to next message
Teun van de Berg is currently offline Teun van de BergFriend
Messages: 12
Registered: October 2014
Junior Member
I call an Acceleo query from Sirius. This query fails (at run time) when written as a one liner but succeeds when split into multiple lines using an intermediate variable. As far as I understand the two are semantically the same, so this seems to be a bug.

Failing query:
[query public myQuery( var : m::type, var2 : m::type) : String =
var.subElement->select(...).anotherQuery()/]


Succeeding query:
[query public myQuery( var : m::type, var2 : m::type) : String =
let a : Integer = var.subElement->select(...) in a.anotherQuery()/]


I have been unable to reproduce the issue in a small isolated setup.
I'm using Acceleo 3.5.1.201409021433.

Stack trace resulting from failing query:
!ENTRY org.eclipse.acceleo.engine 4 4 2014-10-29 15:59:35.256
!MESSAGE Operation op() is undefined on type asml.carm.basics.impl.ConnectionImpl.
!STACK 0
java.lang.UnsupportedOperationException: Operation op() is undefined on type myType.
	at org.eclipse.acceleo.engine.internal.environment.AcceleoLibraryOperationVisitor.getExceptionOperationCallFailed(AcceleoLibraryOperationVisitor.java:1056)
	at org.eclipse.acceleo.engine.internal.environment.AcceleoLibraryOperationVisitor.callStandardOperation(AcceleoLibraryOperationVisitor.java:267)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitOperationCallExp(AcceleoEvaluationVisitor.java:1232)
	at org.eclipse.ocl.ecore.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:384)
	at org.eclipse.ocl.AbstractEvaluationVisitor.visitExpression(AbstractEvaluationVisitor.java:242)
	at org.eclipse.ocl.EvaluationVisitorDecorator.visitExpression(EvaluationVisitorDecorator.java:150)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.switchExpression(AcceleoEvaluationVisitor.java:1910)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitExpression(AcceleoEvaluationVisitor.java:1065)
	at org.eclipse.ocl.internal.evaluation.IterationTemplate.evaluate(IterationTemplate.java:81)
	at org.eclipse.ocl.EvaluationVisitorImpl.evaluateCollectIterator(EvaluationVisitorImpl.java:1967)
	at org.eclipse.ocl.EvaluationVisitorImpl.visitIteratorExp(EvaluationVisitorImpl.java:1817)
	at org.eclipse.ocl.EvaluationVisitorDecorator.visitIteratorExp(EvaluationVisitorDecorator.java:235)
	at org.eclipse.ocl.ecore.impl.IteratorExpImpl.accept(IteratorExpImpl.java:108)
	at org.eclipse.ocl.AbstractEvaluationVisitor.safeVisitExpression(AbstractEvaluationVisitor.java:569)
	at org.eclipse.ocl.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:231)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitOperationCallExp(AcceleoEvaluationVisitor.java:1249)
	at org.eclipse.ocl.ecore.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:384)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor$ParameterInitExpression.accept(AcceleoEvaluationVisitor.java:1967)
	at org.eclipse.ocl.AbstractEvaluationVisitor.safeVisitExpression(AbstractEvaluationVisitor.java:569)
	at org.eclipse.ocl.EvaluationVisitorImpl.visitVariable(EvaluationVisitorImpl.java:2377)
	at org.eclipse.ocl.EvaluationVisitorDecorator.visitVariable(EvaluationVisitorDecorator.java:334)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitAcceleoQueryInvocation(AcceleoEvaluationVisitor.java:848)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.switchExpression(AcceleoEvaluationVisitor.java:1887)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitExpression(AcceleoEvaluationVisitor.java:1065)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitAcceleoQueryInvocation(AcceleoEvaluationVisitor.java:895)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.switchExpression(AcceleoEvaluationVisitor.java:1887)
	at org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitExpression(AcceleoEvaluationVisitor.java:1065)
	at org.eclipse.ocl.internal.evaluation.QueryImpl.evaluate(QueryImpl.java:146)
	at org.eclipse.ocl.ecore.QueryImpl.evaluate(QueryImpl.java:56)
	at org.eclipse.acceleo.engine.generation.AcceleoEngine.doEvaluate(AcceleoEngine.java:411)
	at org.eclipse.acceleo.engine.generation.AcceleoEngine.evaluate(AcceleoEngine.java:203)
	at org.eclipse.acceleo.engine.service.AcceleoEvaluationTask.evaluateQuery(AcceleoEvaluationTask.java:122)
	at org.eclipse.acceleo.engine.service.AcceleoEvaluationTask.call(AcceleoEvaluationTask.java:291)
	at org.eclipse.sirius.common.acceleo.mtl.business.internal.interpreter.DynamicAcceleoModule.evaluate(DynamicAcceleoModule.java:531)
	at org.eclipse.sirius.common.acceleo.mtl.business.internal.interpreter.AcceleoMTLInterpreter.internalEvaluate(AcceleoMTLInterpreter.java:1182)
	at org.eclipse.sirius.common.acceleo.mtl.business.internal.interpreter.AcceleoMTLInterpreter.evaluateString(AcceleoMTLInterpreter.java:693)
	at org.eclipse.sirius.tools.internal.interpreter.ODesignGenericInterpreter.evaluateString(ODesignGenericInterpreter.java:214)
	at org.eclipse.sirius.table.business.internal.refresh.DTableElementSynchronizerSpec.refreshLabel(DTableElementSynchronizerSpec.java:456)
	at org.eclipse.sirius.table.business.internal.refresh.DTableElementSynchronizerSpec.refreshLabel(DTableElementSynchronizerSpec.java:316)
	at org.eclipse.sirius.table.business.internal.refresh.DTableElementSynchronizerSpec.refresh(DTableElementSynchronizerSpec.java:161)
	at org.eclipse.sirius.table.business.internal.refresh.DTableSynchronizerImpl.refreshIntersectionMappingWithoutDomain(DTableSynchronizerImpl.java:914)
	at org.eclipse.sirius.table.business.internal.refresh.DTableSynchronizerImpl.refreshIntersectionMapping(DTableSynchronizerImpl.java:678)
	at org.eclipse.sirius.table.business.internal.refresh.DTableSynchronizerImpl.refreshCellsOfCrossTable(DTableSynchronizerImpl.java:242)
	at org.eclipse.sirius.table.business.internal.refresh.DTableSynchronizerImpl.refreshCells(DTableSynchronizerImpl.java:208)
	at org.eclipse.sirius.table.business.internal.refresh.DTableSynchronizerImpl.refresh(DTableSynchronizerImpl.java:132)
	at org.eclipse.sirius.table.business.internal.dialect.TableDialectServices.refresh(TableDialectServices.java:270)
	at org.eclipse.sirius.business.internal.dialect.DialectManagerImpl.refresh(DialectManagerImpl.java:106)
	at org.eclipse.sirius.business.api.dialect.command.RefreshRepresentationsCommand.doExecute(RefreshRepresentationsCommand.java:85)
	at org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
	at org.eclipse.emf.workspace.EMFCommandOperation.doExecute(EMFCommandOperation.java:119)
	at org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
	at org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:513)
	at org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl.doExecute(WorkspaceCommandStackImpl.java:208)
	at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
	at org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:219)
	at org.eclipse.sirius.table.ui.tools.internal.editor.action.RefreshAction$1.run(RefreshActi
Re: 'Undefined argument' exception using Acceleo query from Sirius [message #1455776 is a reply to message #1455656] Wed, 29 October 2014 18:50 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7679
Registered: July 2009
Senior Member
HI

There are/were related known bugs, but your code seems very suspect.

var.subElement->select(...)

returns a Collection so the subsequent navigation is an implicit collect.

The succeeding query that assigns to an Integer should be a compilation
error. Have you suppressed auto-build? Try restarting the editor.

Regards

Ed Willink



On 29/10/2014 19:19, Teun van de Berg wrote:
> I call an Acceleo query from Sirius. This query fails (at run time) when
> written as a one liner but succeeds when split into multiple lines
> using an intermediate variable. As far as I understand the two are
> semantically the same, so this seems to be a bug.
>
> Failing query:
>
> [query public myQuery( var : m::type, var2 : m::type) : String =
> var.subElement->select(...).anotherQuery()/]
>
>
> Succeeding query:
>
> [query public myQuery( var : m::type, var2 : m::type) : String =
> let a : Integer = var.subElement->select(...) in a.anotherQuery()/]
>
>
> I have been unable to reproduce the issue in a small isolated setup.
> I'm using Acceleo 3.5.1.201409021433.
>
> Stack trace resulting from failing query:
>
> !ENTRY org.eclipse.acceleo.engine 4 4 2014-10-29 15:59:35.256
> !MESSAGE Operation op() is undefined on type
> asml.carm.basics.impl.ConnectionImpl.
> !STACK 0
> java.lang.UnsupportedOperationException: Operation op() is undefined on
> type myType.
> at
> org.eclipse.acceleo.engine.internal.environment.AcceleoLibraryOperationVisitor.getExceptionOperationCallFailed(AcceleoLibraryOperationVisitor.java:1056)
>
> at
> org.eclipse.acceleo.engine.internal.environment.AcceleoLibraryOperationVisitor.callStandardOperation(AcceleoLibraryOperationVisitor.java:267)
>
> at
> org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitOperationCallExp(AcceleoEvaluationVisitor.java:1232)
>
> at
> org.eclipse.ocl.ecore.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:384)
>
> at
> org.eclipse.ocl.AbstractEvaluationVisitor.visitExpression(AbstractEvaluationVisitor.java:242)
>
> at
> org.eclipse.ocl.EvaluationVisitorDecorator.visitExpression(EvaluationVisitorDecorator.java:150)
>
> at
> org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.switchExpression(AcceleoEvaluationVisitor.java:1910)
>
> at
> org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitExpression(AcceleoEvaluationVisitor.java:1065)
>
> at
> org.eclipse.ocl.internal.evaluation.IterationTemplate.evaluate(IterationTemplate.java:81)
>
> at
> org.eclipse.ocl.EvaluationVisitorImpl.evaluateCollectIterator(EvaluationVisitorImpl.java:1967)
>
> at
> org.eclipse.ocl.EvaluationVisitorImpl.visitIteratorExp(EvaluationVisitorImpl.java:1817)
>
> at
> org.eclipse.ocl.EvaluationVisitorDecorator.visitIteratorExp(EvaluationVisitorDecorator.java:235)
>
> at
> org.eclipse.ocl.ecore.impl.IteratorExpImpl.accept(IteratorExpImpl.java:108)
> at
> org.eclipse.ocl.AbstractEvaluationVisitor.safeVisitExpression(AbstractEvaluationVisitor.java:569)
>
> at
> org.eclipse.ocl.EvaluationVisitorImpl.visitOperationCallExp(EvaluationVisitorImpl.java:231)
>
> at
> org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitOperationCallExp(AcceleoEvaluationVisitor.java:1249)
>
> at
> org.eclipse.ocl.ecore.impl.OperationCallExpImpl.accept(OperationCallExpImpl.java:384)
>
> at
> org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor$ParameterInitExpression.accept(AcceleoEvaluationVisitor.java:1967)
>
> at
> org.eclipse.ocl.AbstractEvaluationVisitor.safeVisitExpression(AbstractEvaluationVisitor.java:569)
>
> at
> org.eclipse.ocl.EvaluationVisitorImpl.visitVariable(EvaluationVisitorImpl.java:2377)
>
> at
> org.eclipse.ocl.EvaluationVisitorDecorator.visitVariable(EvaluationVisitorDecorator.java:334)
>
> at
> org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitAcceleoQueryInvocation(AcceleoEvaluationVisitor.java:848)
>
> at
> org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.switchExpression(AcceleoEvaluationVisitor.java:1887)
>
> at
> org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitExpression(AcceleoEvaluationVisitor.java:1065)
>
> at
> org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitAcceleoQueryInvocation(AcceleoEvaluationVisitor.java:895)
>
> at
> org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.switchExpression(AcceleoEvaluationVisitor.java:1887)
>
> at
> org.eclipse.acceleo.engine.internal.evaluation.AcceleoEvaluationVisitor.visitExpression(AcceleoEvaluationVisitor.java:1065)
>
> at
> org.eclipse.ocl.internal.evaluation.QueryImpl.evaluate(QueryImpl.java:146)
> at org.eclipse.ocl.ecore.QueryImpl.evaluate(QueryImpl.java:56)
> at
> org.eclipse.acceleo.engine.generation.AcceleoEngine.doEvaluate(AcceleoEngine.java:411)
>
> at
> org.eclipse.acceleo.engine.generation.AcceleoEngine.evaluate(AcceleoEngine.java:203)
>
> at
> org.eclipse.acceleo.engine.service.AcceleoEvaluationTask.evaluateQuery(AcceleoEvaluationTask.java:122)
>
> at
> org.eclipse.acceleo.engine.service.AcceleoEvaluationTask.call(AcceleoEvaluationTask.java:291)
>
> at
> org.eclipse.sirius.common.acceleo.mtl.business.internal.interpreter.DynamicAcceleoModule.evaluate(DynamicAcceleoModule.java:531)
>
> at
> org.eclipse.sirius.common.acceleo.mtl.business.internal.interpreter.AcceleoMTLInterpreter.internalEvaluate(AcceleoMTLInterpreter.java:1182)
>
> at
> org.eclipse.sirius.common.acceleo.mtl.business.internal.interpreter.AcceleoMTLInterpreter.evaluateString(AcceleoMTLInterpreter.java:693)
>
> at
> org.eclipse.sirius.tools.internal.interpreter.ODesignGenericInterpreter.evaluateString(ODesignGenericInterpreter.java:214)
>
> at
> org.eclipse.sirius.table.business.internal.refresh.DTableElementSynchronizerSpec.refreshLabel(DTableElementSynchronizerSpec.java:456)
>
> at
> org.eclipse.sirius.table.business.internal.refresh.DTableElementSynchronizerSpec.refreshLabel(DTableElementSynchronizerSpec.java:316)
>
> at
> org.eclipse.sirius.table.business.internal.refresh.DTableElementSynchronizerSpec.refresh(DTableElementSynchronizerSpec.java:161)
>
> at
> org.eclipse.sirius.table.business.internal.refresh.DTableSynchronizerImpl.refreshIntersectionMappingWithoutDomain(DTableSynchronizerImpl.java:914)
>
> at
> org.eclipse.sirius.table.business.internal.refresh.DTableSynchronizerImpl.refreshIntersectionMapping(DTableSynchronizerImpl.java:678)
>
> at
> org.eclipse.sirius.table.business.internal.refresh.DTableSynchronizerImpl.refreshCellsOfCrossTable(DTableSynchronizerImpl.java:242)
>
> at
> org.eclipse.sirius.table.business.internal.refresh.DTableSynchronizerImpl.refreshCells(DTableSynchronizerImpl.java:208)
>
> at
> org.eclipse.sirius.table.business.internal.refresh.DTableSynchronizerImpl.refresh(DTableSynchronizerImpl.java:132)
>
> at
> org.eclipse.sirius.table.business.internal.dialect.TableDialectServices.refresh(TableDialectServices.java:270)
>
> at
> org.eclipse.sirius.business.internal.dialect.DialectManagerImpl.refresh(DialectManagerImpl.java:106)
>
> at
> org.eclipse.sirius.business.api.dialect.command.RefreshRepresentationsCommand.doExecute(RefreshRepresentationsCommand.java:85)
>
> at
> org.eclipse.emf.transaction.RecordingCommand.execute(RecordingCommand.java:135)
>
> at
> org.eclipse.emf.workspace.EMFCommandOperation.doExecute(EMFCommandOperation.java:119)
>
> at
> org.eclipse.emf.workspace.AbstractEMFOperation.execute(AbstractEMFOperation.java:150)
>
> at
> org.eclipse.core.commands.operations.DefaultOperationHistory.execute(DefaultOperationHistory.java:513)
>
> at
> org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl.doExecute(WorkspaceCommandStackImpl.java:208)
>
> at
> org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:165)
>
> at
> org.eclipse.emf.transaction.impl.AbstractTransactionalCommandStack.execute(AbstractTransactionalCommandStack.java:219)
>
> at
> org.eclipse.sirius.table.ui.tools.internal.editor.action.RefreshAction$1.run(RefreshActi
>
>
Re: 'Undefined argument' exception using Acceleo query from Sirius [message #1456644 is a reply to message #1455776] Thu, 30 October 2014 15:25 Go to previous messageGo to next message
Teun van de Berg is currently offline Teun van de BergFriend
Messages: 12
Registered: October 2014
Junior Member
Hi,

Thanks for the reply. My examples contained an error.
someOtherQuery->sum()
is performed on the result of select. I've provided corrected examples below. The stacktrace also contains some more potentially relevant information:

!MESSAGE Undefined argument subElement->collect(temp13 : SubElementType | temp13.someOtherQuery())->sum() of invocation at line 0 in Module diagramQueries for block anotherQuery(subElement->collect(temp13 : SubElementType | temp13.anotherQuery)->sum()).


Corrected examples (changes from original post in bold:

Failing query:
[query public myQuery( var : m::type, var2 : m::type) : String =
var.subElement->select(...).someOtherQuery->sum().anotherQuery()/]


Succeeding query:
[query public myQuery( var : m::type, var2 : m::type) : String =
let a : Integer = var.subElement->select(...).someOtherQuery->sum() in a.anotherQuery()/]


I don't see any open bugs for Acceleo. I'll have a look at the OCL bugs.

Kind regards,
Teun
Re: 'Undefined argument' exception using Acceleo query from Sirius [message #1457599 is a reply to message #1456644] Fri, 31 October 2014 13:51 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7679
Registered: July 2009
Senior Member
Hi

Looks like a familiar Acceleo bug.

In this case it may be aggravated by use of Integer for which Acceleo
can get confused between the user's Integer and the tooling's Integer.

Regards

Ed Willink


On 30/10/2014 15:25, Teun van de Berg wrote:
> Hi,
>
> Thanks for the reply. My examples contained an error.
> someOtherQuery->sum() is performed on the result of select. I've
> provided corrected examples below. The stacktrace also contains some
> more potentially relevant information:
>
>
> !MESSAGE Undefined argument subElement->collect(temp13 : SubElementType
> | temp13.someOtherQuery())->sum() of invocation at line 0 in Module
> diagramQueries for block anotherQuery(subElement->collect(temp13 :
> SubElementType | temp13.anotherQuery)->sum()).
>
>
> Corrected examples (changes from original post in bold:
>
> Failing query:
>
> [query public myQuery( var : m::type, var2 : m::type) : String =
> var.subElement->select(...).someOtherQuery->sum().anotherQuery()/]
>
>
> Succeeding query:
>
> [query public myQuery( var : m::type, var2 : m::type) : String =
> let a : Integer = var.subElement->select(...).someOtherQuery->sum() in
> a.anotherQuery()/]
>
>
> I don't see any open bugs for
> https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&classification=Modeling&component=Acceleo&product=M2T&title=Acceleo%20Bugs.
> I'll have a look at the
> https://bugs.eclipse.org/bugs/buglist.cgi?bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&classification=Modeling&list_id=10377844&product=MDT.OCL&query_format=advanced.
>
>
> Kind regards,
> Teun
Re: 'Undefined argument' exception using Acceleo query from Sirius [message #1461175 is a reply to message #1457599] Tue, 04 November 2014 09:30 Go to previous message
Teun van de Berg is currently offline Teun van de BergFriend
Messages: 12
Registered: October 2014
Junior Member
Hi,

Thanks for the reply. Should I submit this bug to the bug list? The list of open Acceleo bugs seems to be empty.

Kind regards,
Teun

[Updated on: Tue, 04 November 2014 09:30]

Report message to a moderator

Previous Topic:Using stereotypes in EGL
Next Topic:Re: Run-time errors in queries and templates
Goto Forum:
  


Current Time: Fri Nov 08 23:02:58 GMT 2024

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

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

Back to the top