Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [JET] Switching on eClass()
[JET] Switching on eClass() [message #100774] Tue, 06 November 2007 06:35 Go to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

I am trying to use EMF JET to traverse an EMF model. I am able to access the
members of the model, but I need the equivalent of the EMF Switch utility
class to distinguish instances of subclasses. I would like to use the
built-in XPath functions, if possible.

Concrete case: I have a Script metaclass, which has an eReference to a Steps
Metaclass, that are of different subtypes. I have to produce different
output for each case. How can I write this in EMF JET?

What is the test predicate of the conditional?

<c:when test="value">
content to process if tag condition is satisfied
</c:when>
Re: [JET] Switching on eClass() [message #100826 is a reply to message #100774] Tue, 06 November 2007 12:27 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Jörn,

I'll redirect your JET question to the M2T newsgroup which I've added to
the "to" list of the reply.


Jörn Guy Süß wrote:
> I am trying to use EMF JET to traverse an EMF model. I am able to access the
> members of the model, but I need the equivalent of the EMF Switch utility
> class to distinguish instances of subclasses. I would like to use the
> built-in XPath functions, if possible.
>
> Concrete case: I have a Script metaclass, which has an eReference to a Steps
> Metaclass, that are of different subtypes. I have to produce different
> output for each case. How can I write this in EMF JET?
>
> What is the test predicate of the conditional?
>
> <c:when test="value">
> content to process if tag condition is satisfied
> </c:when>
>
>
>
Re: [JET] Switching on eClass() [message #100853 is a reply to message #100826] Tue, 06 November 2007 14:10 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
J
Re: [JET] Switching on eClass() [message #100965 is a reply to message #100853] Wed, 07 November 2007 04:21 Go to previous message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

Paul,

Yes that helped. I know XPath pretty well, just the mapping is a bit
difficult. I have put an entry on the JET FAQ/Wiki, at
http://wiki.eclipse.org/JET_FAQ_How_do_I_test_for_the_type/E Class_of_an_element_in_XPath%3F
but your explanation is much richer.
Maybe you want to update the entry?

Thanks for the information!!

"Paul Elder" <pelder@ca.ibm.com> wrote in message
news:fgpsn1$chq$1@build.eclipse.org...
> J
Re: [JET] Switching on eClass() [message #610238 is a reply to message #100774] Tue, 06 November 2007 12:27 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33132
Registered: July 2009
Senior Member
Jörn,

I'll redirect your JET question to the M2T newsgroup which I've added to
the "to" list of the reply.


Jörn Guy Süß wrote:
> I am trying to use EMF JET to traverse an EMF model. I am able to access the
> members of the model, but I need the equivalent of the EMF Switch utility
> class to distinguish instances of subclasses. I would like to use the
> built-in XPath functions, if possible.
>
> Concrete case: I have a Script metaclass, which has an eReference to a Steps
> Metaclass, that are of different subtypes. I have to produce different
> output for each case. How can I write this in EMF JET?
>
> What is the test predicate of the conditional?
>
> <c:when test="value">
> content to process if tag condition is satisfied
> </c:when>
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: [JET] Switching on eClass() [message #610242 is a reply to message #100826] Tue, 06 November 2007 14:10 Go to previous message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
J
Re: [JET] Switching on eClass() [message #610258 is a reply to message #100853] Wed, 07 November 2007 04:21 Go to previous message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

Paul,

Yes that helped. I know XPath pretty well, just the mapping is a bit
difficult. I have put an entry on the JET FAQ/Wiki, at
http://wiki.eclipse.org/JET_FAQ_How_do_I_test_for_the_type/E Class_of_an_element_in_XPath%3F
but your explanation is much richer.
Maybe you want to update the entry?

Thanks for the information!!

"Paul Elder" <pelder@ca.ibm.com> wrote in message
news:fgpsn1$chq$1@build.eclipse.org...
> J
Previous Topic:UMLProfile vs Ecore
Next Topic:[CDO] No client notifications when changes saved
Goto Forum:
  


Current Time: Sat Apr 13 11:03:49 GMT 2024

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

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

Back to the top