Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » MTL and Element id
MTL and Element id [message #50796] Fri, 26 September 2008 10:31 Go to next message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
Hey MTLer,

i'm trying to read out the id of an EMFObject for the use of traceability,
like it is mentioned in the specification.
My current approach was exactly was i have found in the spec:
[c.id]
But this fails of course, because there is no attribute like id in the
element but in the XMI serialization.
And by the way, is it possible to extend the MTL with an external function,
which could be implemented in JAVA? The capabilities of the macro definition
are very restricted.

Thx in advance
Timothy
Re: MTL and Element id [message #50824 is a reply to message #50796] Fri, 26 September 2008 11:19 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060702060605010505070002
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hi Timyothy,

First of all, the traceBlock as defined in the specification isn't
implemented yet as far as the evaluation engine is concerned. As for the
"id" attribute ... well this might be yet another issue of the spec.

As for extending MTL with Java defined external functions, this is
something we're thinking about but it clearly isn't a priority since we
need to fully implement the specification itself before thinking about
extending it. You're stuck with macros/queries for now :(.

Regards,

Laurent Goubet
Obeo

Timothy Marc a
Re: MTL and Element id [message #50851 is a reply to message #50824] Fri, 26 September 2008 12:18 Go to previous messageGo to next message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
Dear Laurent,

so, if i understand it right, it is so, that i have no possibility to get an
element's id? But, to prevent missunderstaning, i don't need the trace block
of the spec. I just need the access to the ids.

Timothy

"laurent Goubet" <laurent.goubet@obeo.fr> schrieb im Newsbeitrag
news:gbigfg$lie$1@build.eclipse.org...
> Hi Timyothy,
>
> First of all, the traceBlock as defined in the specification isn't
> implemented yet as far as the evaluation engine is concerned. As for the
> "id" attribute ... well this might be yet another issue of the spec.
>
> As for extending MTL with Java defined external functions, this is
> something we're thinking about but it clearly isn't a priority since we
> need to fully implement the specification itself before thinking about
> extending it. You're stuck with macros/queries for now :(.
>
> Regards,
>
> Laurent Goubet
> Obeo
>
> Timothy Marc a
Re: MTL and Element id [message #51047 is a reply to message #50851] Tue, 30 September 2008 07:50 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000809090502080008080909
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hi Timothy,

AFAIK, there is no way to get the XMI ID of an element other than to get
it directly from the XMIResource reference. That can only be done in
Java and we do not provide a way to define custom operations in MTL as
yet (again, this will most probably evolve in the future).

However, if what you seek to obtain is not the XMI ID but rather the "ID
attribute" of an EClass, you can do so by iterating over all of its
attributes and selecting the one for which attr.isId() returns true.

Laurent Goubet
Obeo

Timothy Marc a
Re: MTL and Element id [message #51073 is a reply to message #51047] Tue, 30 September 2008 07:57 Go to previous message
Timothy Marc is currently offline Timothy MarcFriend
Messages: 547
Registered: July 2009
Senior Member
Hey Laurent,

thanks again.

Timothy

"laurent Goubet" <laurent.goubet@obeo.fr> schrieb im Newsbeitrag
news:gbslo2$in7$1@build.eclipse.org...
> Hi Timothy,
>
> AFAIK, there is no way to get the XMI ID of an element other than to get
> it directly from the XMIResource reference. That can only be done in
> Java and we do not provide a way to define custom operations in MTL as
> yet (again, this will most probably evolve in the future).
>
> However, if what you seek to obtain is not the XMI ID but rather the "ID
> attribute" of an EClass, you can do so by iterating over all of its
> attributes and selecting the one for which attr.isId() returns true.
>
> Laurent Goubet
> Obeo
>
> Timothy Marc a
Previous Topic:JMerge customization
Next Topic:Extending the JET2 TagLibrary
Goto Forum:
  


Current Time: Thu Dec 26 11:22:42 GMT 2024

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

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

Back to the top