|
Re: Acceleo: Cannot make c.id() works. [message #857541 is a reply to message #857527] |
Thu, 26 April 2012 16:30 |
Ed Willink Messages: 7670 Registered: July 2009 |
Senior Member |
|
|
Hi
The MOFM2T specification seems to use c.id() without ever defining its
semantics, so there is no guarantee as to how 'unique' an id might be.
Unique with respect to parent, resource, resource set, multiple sessions
??? PLease raise an OMG issue.
The Acceleo capability to 'invoke' a Java function is a very useful
solution to this kind of problem. Just invoke a function that returns an
incrementing static count and the query cache will ensure that re-calls
get the same value.
Regards
Ed Willink
On 26/04/2012 17:11, Alain Lavoie wrote:
> Hi all,
>
> In Acceleo, I am not able to used the id() related to any XMI items I
> parse. In the MOFM2T, they present
> the c.id() as returning the unique id of a UML!Class (if c:Class).
>
> From web searches, I found an old discussion on the access
> of this id() via Acceleo services. Is this still the case in Acceleo ?
>
> The 2009 discussion present this code snippet:
> ---
> public String getXMIID(EObject element) { if (element.eResource
> instanceof XMIResource) return
> ((XMIResource)element.eResource()).getID(); return ""; }
> ---
>
> If I have to follow that advise, can somebody redirect me on a tutorial
> or give a brief overview of how to access this code from a template.mtl
> file ?
>
> Regards.
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04040 seconds