Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » [ATL] Unresolved cross-reference... Again
[ATL] Unresolved cross-reference... Again [message #896019] Mon, 16 July 2012 23:17
EtienneB Mising name is currently offline EtienneB Mising name
Messages: 35
Registered: June 2011
Member
Hi,

I am having problems with cross referenced models using ATL.

Here is my context:

I execute Xtext as a stand-alone Java application to parse a set of files. As an output, I obtain a set of ecore model stored in a single resource set. I then apply a model transformation using ATL (still stand-alone). When executing the transformation, I get an error message saying that one of the referenced object is null but the trace contains the name of this object...

Here is the content of the resource (after saving it in a xmi file) that represents the object I take as input of my faulty transformation rule:

  <componentInstance xmi:id="_TH4iUM62EeGfzdj5pK2F1w" name="the_mem" category="memory">
    <ownedPropertyAssociation xmi:id="_TIPHoM62EeGfzdj5pK2F1w">
      <property href="file:/home/etienne/Dev/propertyset/Memory_Properties.aadl2#//@ownedProperty.11"/>
      <ownedValue xmi:id="_TIPHoc62EeGfzdj5pK2F1w">
        <ownedValue xsi:type="aadl2:IntegerLiteral" xmi:id="_TIPHos62EeGfzdj5pK2F1w" value="80000"/>
      </ownedValue>
    </ownedPropertyAssociation>
    <subcomponent xsi:type="aadl2:MemorySubcomponent" href="file:/home/etienne/test/arinc653-blackboard/test_blackboard.aadl2#//@ownedPublicSection/@ownedClassifier.1/@ownedMemorySubcomponent.0"/>
  </componentInstance>


Now, here is the ATL rule that transforms this object:

rule Memory_Instance {
	from
		c : AADLI!ComponentInstance (c.category = #memory)
	to
		sub : AADLBA!MemorySubcomponent(
			name <- c.name.debug('memory instance'),
			ownedPropertyAssociation <- c.ownedPropertyAssociation->collect (e|thisModule.PropertyAssociation (e))
		)
}

lazy rule PropertyAssociation {
	from
		p : AADLI!PropertyAssociation
	to
		p2 : AADLBA!PropertyAssociation (
			property <- p.property.debug('  property')
		)
}


When launching the model transformation, I allow inter model cross references:


Map<String, Object> options = new HashMap<String, Object>() ;
options.put("allowInterModelReferences", "true") ;
launcher.launch(EMFVMLauncher.RUN_MODE, new NullProgressMonitor(), options, atlModules) ;



When I execute my java standalone application, I obtain the following trace:

system instance: 'root.impl'
memory instance: 'the_mem'
  property: MEMORY_PROPERTIES!Byte_Count
org.eclipse.m2m.atl.engine.emfvm.VMException: org.eclipse.m2m.atl.engine.emfvm.lib.OclUndefined cannot be cast to Property


What is funny is that the trace suggests that the Property object is null, while "Byte_Count" is actually the value of the field name in the object...

I did not find any solution; when debugging, I see that objects are correctly set, but I get this obscure behavior when executing the model transformation.

Thanks for your help,
Etienne.
Previous Topic:ATL Execution Error
Next Topic:Problem finalizing Model with stereotypes on association ends applied
Goto Forum:
  


Current Time: Tue Sep 16 09:50:30 GMT 2014

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

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