Bug 522434 - Acceleo 3 expressions are not interpreted when used in properties widgets
Summary: Acceleo 3 expressions are not interpreted when used in properties widgets
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Properties (show other bugs)
Version: 5.0.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2017-09-18 10:52 EDT by Pierre Guilet CLA
Modified: 2018-07-18 03:44 EDT (History)
2 users (show)

See Also:


Attachments
project to reproduce (4.67 KB, application/x-zip-compressed)
2017-09-18 10:52 EDT, Pierre Guilet CLA
no flags Details
project to reproduce (4.88 KB, application/x-zip-compressed)
2017-09-18 10:58 EDT, Pierre Guilet CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Guilet CLA 2017-09-18 10:52:58 EDT
Created attachment 270244 [details]
project to reproduce

When an Acceleo 3 expression ['test'/] is used in a widget like the text one for value or label expression for example, the expression is not taken into account and the property widget does not show the result of the expression without showing any log explaining why.

The problem is the following: 

Status WARNING: org.eclipse.acceleo.parser code=1 Problems encountered while compiling expression null children=[Status WARNING: org.eclipse.acceleo.parser code=0 A variable should not be named 'self'. This name is an Acceleo or OCL keyword. null]

The problem seems to lie in org.eclipse.sirius.common.acceleo.mtl.business.internal.interpreter.AcceleoMTLInterpreter.createCompilationContext(EObject, String)

The created compilation context contains the self variable that seems to be forbidden by the acceleo interpreter:

The stack leading to this variable setting is the following:

AcceleoMTLInterpreter.setVariable(String, Object) line: 880	
	SessionInterpreter.setVariable(String, Object) line: 389	
	SiriusInterpreter.declareLocals(Map<String,Object>, IInterpreter) line: 86	
	SiriusInterpreter.setupInterpreter(Map<String,Object>) line: 79	
	SiriusInterpreter.evaluateExpression(Map<String,Object>, String) line: 63	
	EvalFactory$Eval<TYPE>.call(String, Consumer<TYPE>) line: 204	
	EEFViewImpl.initialize() line: 129	
	EEFViewFactory.createEEFView(EEFViewDescription, IVariableManager, IInterpreter, EditingContextAdapter, IEEFDomainClassTester, InputDescriptor) line: 66	
	SiriusTabDescriptorProvider.createEEFView(Session, SiriusInputDescriptor, EEFViewDescription) line: 100	
	SiriusTabDescriptorProvider.getTabDescriptors(Session, SiriusInputDescriptor, List<PageDescription>) line: 90	
	SiriusTabDescriptorProvider.getTabDescriptors(SiriusInputDescriptor) line: 85	
	SiriusTabDescriptorProvider.get(IWorkbenchPart, ISelection, IEEFTabbedPropertySheetPageContributor) line: 68	
	EEFTabbedPropertyRegistry.getAllTabDescriptors(IWorkbenchPart, ISelection) line: 81	
	EEFTabbedPropertyRegistry.getTabDescriptors(IWorkbenchPart, ISelection) line: 123	
	EEFTabbedPropertySheetPage.doSetInput(IWorkbenchPart, ISelection) line: 310	
	EEFTabbedPropertySheetPage.setInput(IWorkbenchPart, ISelection) line: 256	
	EEFTabbedPropertySheetPage.selectionChanged(IWorkbenchPart, ISelection) line: 239	

Steps to reproduce:
1- import the attached project.
2-open the "new root" diagram
3-select the EClass

The properties view contains the widget MyWidget that is empty whereas the label of the EClass that is "test" comes from the same A3 expression used in style label. 

4-change the text widget value A3 expression by aql:'test'

MyWidget has the "test" value.
Comment 1 Pierre Guilet CLA 2017-09-18 10:58:16 EDT
Created attachment 270245 [details]
project to reproduce
Comment 2 Florian Barbin CLA 2017-09-28 11:13:21 EDT
Issue reproduced with the given test case. Marked as triaged.