Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] unresolved proxy(trying to generate qualfiedName for UML model)
[Acceleo] unresolved proxy [message #1385897] Thu, 12 June 2014 07:54 Go to next message
Wilbert Alberts is currently offline Wilbert AlbertsFriend
Messages: 209
Registered: June 2010
Senior Member
Hi,

I created a meta model that I use to hold metrics for an SysML model. I refers to packages / Namespaces of the original model (being the source of the metrics). An acceleo M2T transformation is created to generate a readable report. In that report I want to print the full qualified name of the Namespace element. Somehow that fails.

I observe the following:
- When using the acceleo runner, nothing happens at all.
- When using the java runner, I get an 'Invalid result for expression' error.

Following the latter one i extended my template such that it generates a stringified version of the Namespace reference. I think that it is a proxy object (given this representation: org.eclipse.uml2.uml.internal.impl.PackageImpl@5ef50743 (eProxyURI: file:/C:/Localdata/eclipse.ws/luna-gendoc/AlarmRadio/AlarmRadio.uml#_vRcikGdmEeCqgM2a9IX2Gw))

Then I remembered that the 'doGenerate' method of the generator contains a remark concerning resolving proxies. I removed the comments as noted so my generator holds a statement like: org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(model).

Still no luck. Any ideas? Attached you find the metrics meta model, its genmodel, an example model and the acceleo template that I used to generate the report.

I used Luna RC3 Release (4.4.0RC3) Build id: 20140604-2256 with Acceleo 3.5.0.201406031320

Greetings,
Wiblert.





Re: [Acceleo] unresolved proxy [message #1385905 is a reply to message #1385897] Thu, 12 June 2014 08:23 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

On 12/06/2014 08:54, Wilbert Alberts wrote:
> Hi,
>
> I created a meta model that I use to hold metrics for an SysML model. I refers to packages / Namespaces of the original model (being the source of the metrics). An acceleo M2T transformation is created to generate a readable report. In that report I want to print the full qualified name of the Namespace element. Somehow that fails.
>
> I observe the following:
> - When using the acceleo runner, nothing happens at all.
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=395726
> - When using the java runner, I get an 'Invalid result for expression' error.
>
> Following the latter one i extended my template such that it generates a stringified version of the Namespace reference. I think that it is a proxy object (given this representation: mailto:org.eclipse.uml2.uml.internal.impl.PackageImpl@5ef50743 (eProxyURI: file:/C:/Localdata/eclipse.ws/luna-gendoc/AlarmRadio/AlarmRadio.uml#_vRcikGdmEeCqgM2a9IX2Gw))
>
> Then I remembered that the 'doGenerate' method of the generator contains a remark concerning resolving proxies. I removed the comments as noted so my generator holds a statement like: org.eclipse.emf.ecore.util.EcoreUtil.resolveAll(model).
Try model.getResourceSet() to ensure that transitive proxies are resolved.

Or set a breakpoint at the retry in

EcoreUtil.resolve(EObject proxy, ResourceSet resourceSet)

so that you can step through the resolution failure.

Regards

Ed Willink
Previous Topic:[Acceleo] Format date in acceleo
Next Topic:Generate UUID
Goto Forum:
  


Current Time: Fri Apr 26 12:26:43 GMT 2024

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

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

Back to the top