Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Model-to-Model Transformation » [ATL] Unresolved cross-reference... Again
[ATL] Unresolved cross-reference... Again [message #895687] Sun, 15 July 2012 00:36 Go to next message
EtienneB Mising name is currently offline EtienneB Mising nameFriend
Messages: 35
Registered: June 2011
Member
Hi,

I am having problems with cross referenced models using ATL.

Here is my context:

I take as input a resource that references other resource with proxies set as href='/home/...' or href='project/...'.

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 read on a forum that the solution could be to have homogeneous and well-formed proxies like "href=file:/...". Is that so? Then is there an API to force proxies to use a given format?

Any other suggestion?
Etienne.

[Updated on: Sun, 15 July 2012 00:41]

Report message to a moderator

Re: [ATL] Unresolved cross-reference... Again [message #895755 is a reply to message #895687] Sun, 15 July 2012 18:37 Go to previous messageGo to next message
EtienneB Mising name is currently offline EtienneB Mising nameFriend
Messages: 35
Registered: June 2011
Member
To be more precise on the potential solution I wwas referring to, here is the link to the previous discussion about this subject:

http://www.eclipse.org/forums/index.php/mv/msg/163531/517584/

Unfortunately, the solution proposed in this discussion does not work for me: even if the proxy to the reference objet is specified with a file:/home form, the proxy is not resolved.

To be more precise in the description of my execution context, I must say that I use xtext to parse my input language. However, I don't see any null element in the resource I obtain after executing the xtext-based parsing.

Any suggestion?
Thanks for your help,
Etienne.
Re: [ATL] Unresolved cross-reference... Again [message #895759 is a reply to message #895755] Sun, 15 July 2012 19:43 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

There is now an ATL new group, news://news.eclipse.org/eclipse.atl,
where you may get a more meanigfuil; response, but so long as you
provide little more than rumour as your problem report, it may need a
little telepathy to deduce your problem. If nobody is feeling
telepathic, you will get no response.

Regards

Ed Willink

On 15/07/2012 19:37, EtienneB Mising name wrote:
> To be more precise on the potential solution I wwas referring to, here
> is the link to the previous discussion about this subject:
>
> http://www.eclipse.org/forums/index.php/mv/msg/163531/517584/
>
> Unfortunately, the solution proposed in this discussion does not work
> for me: even if the proxy to the reference objet is specified with a
> file:/home form, the proxy is not resolved.
>
> To be more precise in the description of my execution context, I must
> say that I use xtext to parse my input language. However, I don't see
> any null element in the resource I obtain after executing the
> xtext-based parsing.
>
> Any suggestion?
> Thanks for your help,
> Etienne.
Re: [ATL] Unresolved cross-reference... Again [message #895772 is a reply to message #895759] Sun, 15 July 2012 22:02 Go to previous messageGo to next message
EtienneB Mising name is currently offline EtienneB Mising nameFriend
Messages: 35
Registered: June 2011
Member
Thanks for the reply, and the info about the ATL new group. Not to have anybody try telepathy, I will provide more information.

I will keep on posting on this forum in case a solution emerges and someone could reuse it.

To give more information, 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="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')
		)
}


Is the problem due to using "href=file:/ ..." and then "href=test ..."? If so, is there a way to force proxies to have homogeneous uris?

Other ideas?

Thanks,
Etienne.

[Updated on: Sun, 15 July 2012 22:04]

Report message to a moderator

Re: [ATL] Unresolved cross-reference... Again [message #895839 is a reply to message #895772] Mon, 16 July 2012 09:13 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

It is much clearer with an example, though I'm not sure what the actual
prioblem you see is. There should be no need for all URIs to be
absolute, however if a relative URI is used, it is important that both
writer and reader have the same understanding of the baseURI against
which to resolve the relative URI.

The reader should be straightforward, with EMF resolving against the URI
of the enclosing resource, so the problem may lie in the writer or
activities between writing and reading. However I'm not familiar with
ATL so I do not know whether it has special 'helpful' resolution
algorithms to simulate platform URIs when running standalone. Such
algorithms frequently malfunction.

Forcing the Ecore to be written with absolute URIs might make the
problem go away, but it will probably reoccur somewhere else. You need
to understand how your URIs are being created. XMLHelperImpl.deresolve()
or URIHandlerImpl.deresolve() are where you need to set breakpoints.
EcoreUtil.resolveProxy() is also helpful sometimes.

The Sample Ecore Editor provides a good arbitrator between a bad writer
and a bad reader.

Regards

Ed Willink


On 15/07/2012 23:02, EtienneB Mising name wrote:
> Thanks for the reply, and the info about the ATL new group. Not to
> have anybody try telepathy, I will provide more information.
>
> I will keep on posting on this forum in case a solution emerges and
> someone could reuse it.
>
> To give more information, 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="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')
> )
> }
>
> Is the problem due to using "href=file:/ ..." and then "href=test
> ..."? If so, is there a way to force proxies to have homogeneous uris?
>
> Other ideas?
>
> Thanks,
> Etienne.
Re: [ATL] Unresolved cross-reference... Again [message #896018 is a reply to message #895839] Mon, 16 July 2012 23:02 Go to previous message
EtienneB Mising name is currently offline EtienneB Mising nameFriend
Messages: 35
Registered: June 2011
Member
Hi,

well, actually I found a way to test with absolute URIs all over the place.
It did not solve the problem. I will put a message on the news group dedicated to ATL. Thanks for the help, and sorry for posting in two different groups.

Etienne.
Previous Topic:M2M for genmodel
Next Topic:[ATL][AML]Information on AML
Goto Forum:
  


Current Time: Tue Apr 16 15:43:45 GMT 2024

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

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

Back to the top