Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [ETL] Transformation can't access part of metamodel
[ETL] Transformation can't access part of metamodel [message #1038820] Thu, 11 April 2013 07:28 Go to next message
Balázs Grill is currently offline Balázs Grill
Messages: 8
Registered: July 2009
Junior Member
Hello,

I'm experiencing some difficulties with transformations when I try to follow references through files. The simplified model is like this:

test.asm.xmi:
- AssemblerObject (name = asm.test)
- InstructionCall (instruction = <Reference to MOVLW element below>)
- InstructionCallParameter (definition = <Reference to parameter element under MOVLW>, value = 5)

instructionSet.xmi:
- InstructionSet (name = iset)
- Instruction (name = MOVLW)
- InstructionParameter (defaultValue = 0)

The input of the transformation is the test.asm.xmi file and it fails at the following code:

rule assemble 
	transform assem : asm!AssemblerObject
	to hexfile : hex!HexFile {
	
	for (call in assem.instructions) { 
		
		var i = call.instruction;
			
		i.eClass.println();	
		call.println();
		i.eIsProxy().println();
		i.name.println(); // Execution fails here, because it can't find 'name' property, but it's obviously there
			
	}
}


Is this because the referenced Instruction (variable i) is in another resource? I can query its metamodel, even list its eStructuralFeatures but still can't access the values of any of its properties.

The whole project (with metamodels, transformation and ant script) can be accessed here: github.com/balazsgrill/junk/tree/Epsilon/epsilon-test

Thanks for any help in advance.
Balázs;
Re: [ETL] Transformation can't access part of metamodel [message #1040302 is a reply to message #1038820] Sat, 13 April 2013 06:37 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 833
Registered: July 2009
Senior Member
Hi Balázs,

Could you please store and share your launch configuration as well with the project on GitHub? I've tried to reproduce this with the one attached (had to comment out lines 84-88 as they refer to a Java tool I don't have) and it seems to be working fine for me.

Cheers,
Dimitris
Re: [ETL] Transformation can't access part of metamodel [message #1041482 is a reply to message #1040302] Mon, 15 April 2013 02:51 Go to previous message
Balázs Grill is currently offline Balázs Grill
Messages: 8
Registered: July 2009
Junior Member
Hi!

Yes, the currently uploaded version works, because it uses the reflective Ecore API instead of the EMF property name, see line 19-20:

		//var i_parameters = i.parameters; 
		var i_parameters = i.eGet(i.eClass.eStructuralFeatures[0]); 


If you uncomment line 19, it will fail with the following exception:

Property 'parameters' not found in object org.eclipse.emf.ecore.impl.DynamicEObjectImpl@265b6acb [eProxyURI: file:/C:/work/git/junk/epsilon-test/microchip.pic16.instructions.xmi#//@instructions.25 eClass: org.eclipse.emf.ecore.impl.EClassImpl@50c02acb [name: Instruction] [instanceClassName: null] [abstract: false, interface: false]] (C:\work\git\junk\epsilon-test\compiler.assemble.etl@19:29)
	at org.eclipse.epsilon.eol.execute.introspection.java.JavaPropertyGetter.invoke(JavaPropertyGetter.java:48)
	at org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointExecutor.java:70)
	at org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointExecutor.java:44)
	at org.eclipse.epsilon.eol.execute.PointExecutor.execute(PointExecutor.java:90)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:226)
	at org.eclipse.epsilon.eol.execute.AssignExecutor.execute(AssignExecutor.java:48)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:226)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:196)
	at org.eclipse.epsilon.eol.execute.StatementBlockExecutor.execute(StatementBlockExecutor.java:26)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:226)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:196)
	at org.eclipse.epsilon.eol.execute.ForStatementExecutor.execute(ForStatementExecutor.java:111)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:226)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:196)
	at org.eclipse.epsilon.eol.execute.StatementBlockExecutor.execute(StatementBlockExecutor.java:26)
	at org.eclipse.epsilon.eol.execute.ExecutorFactory.executeAST(ExecutorFactory.java:226)
	at org.eclipse.epsilon.etl.TransformRule.executeSuperRulesAndBody(TransformRule.java:264)
	at org.eclipse.epsilon.etl.TransformRule.transform(TransformRule.java:200)
	at org.eclipse.epsilon.etl.strategy.FastTransformationStrategy.executeTransformations(FastTransformationStrategy.java:165)
	at org.eclipse.epsilon.etl.strategy.FastTransformationStrategy.transformModels(FastTransformationStrategy.java:157)
	at org.eclipse.epsilon.etl.EtlModule.execute(EtlModule.java:126)
	at org.eclipse.epsilon.workflow.tasks.ExecutableModuleTask.executeImpl(ExecutableModuleTask.java:193)
	... 24 more


Further inspection revealed that if I use generated EMF code registered in the platform the transformation runs successfully. The problem only exists when simple ecore files are used and the model is loaded into dynamic eobjects.

Balázs;
Previous Topic:[ETL] running ETL from Xtext validation process
Next Topic:[ETL] using generated EMF code instead of dynamicEObjects
Goto Forum:
  


Current Time: Thu Aug 21 18:19:34 EDT 2014

Powered by FUDForum. Page generated in 0.02225 seconds