Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Connection order
Connection order [message #527417] Thu, 15 April 2010 08:27 Go to next message
Dennis sui is currently offline Dennis suiFriend
Messages: 35
Registered: February 2010
Member
Hi,

I use EMF / GMF with a XML parser.

I want to realize the following structure:

<If condition="day=monday">
     <execute file="test1">
     <ElseIf condition="day=tuesday" />
          <execute file="test2"/>
          <start name="something"/>
     <ElseIf condition="day=Wednesday"/>
          <start name="something else"/>
     <Else/>
          <execute file="test3"/>
</If>


graphically i want something like this:
http://img265.imageshack.us/img265/9145/flowchart1.png

My problems are now:
1. Is there a way to tell the XML Parser how to sort the elements in the XML File?
because all elements are children of <If>.

2. because of <execute> and <start> are also children of <If>, i don't now how to draw them as children of <ElseIf> or <Else>

I hope this explanation was clear and someone can give me some tips.
Re: Connection order [message #527467 is a reply to message #527417] Thu, 15 April 2010 11:19 Go to previous messageGo to next message
Enrico Schnepel is currently offline Enrico SchnepelFriend
Messages: 121
Registered: July 2009
Senior Member
Hello Sui,

if you can live with you can use the following structure:

<when>
<case condition="day=monday">
<execute file="test1">
</case>
<case condition="day=tuesday" >
<execute file="test2"/>
<start name="something"/>
</case>
<case condition="day=Wednesday">
<start name="something else"/>
</case>
<default>
<execute file="test3"/>
</default>
</when>

Your structure doesn't have the nested elements as I would expect them in
XML. It is somewhat like a token based textual syntax forced into XML
blocks. To be more concrete... the first execute is below the if. then comes
the elseif which closes immedialtly. the next execute is again below the if
but is meant to be below the elseif condition.

to cope with your structure you would need to make a lot of GMF customizing
or create on-the-fly an in-memory-editor-model having the correct object
containment relationships.

Enrico

"Sui" <suithedoc@arcor.de> schrieb im Newsbeitrag
news:hq6ili$2tv$1@build.eclipse.org...
> Hi,
>
> I use EMF / GMF with a XML parser.
>
> I want to realize the following structure:
>
>
> <If condition="day=monday">
> <execute file="test1">
> <ElseIf condition="day=tuesday" />
> <execute file="test2"/>
> <start name="something"/>
> <ElseIf condition="day=Wednesday"/>
> <start name="something else"/>
> <Else/>
> <execute file="test3"/>
> </If>
>
>
> graphically i want something like this:
>
>
> My problems are now:
> 1. Is there a way to tell the XML Parser how to sort the elements in the
> XML File?
> because all elements are children of <If>.
>
> 2. because of <execute> and <start> are also children of <If>, i don't now
> how to draw them as children of <ElseIf> or <Else>
>
> I hope this explanation was clear and someone can give me some tips.
>
Re: Connection order [message #527470 is a reply to message #527467] Thu, 15 April 2010 11:51 Go to previous messageGo to next message
Dennis  is currently offline Dennis Friend
Messages: 1
Registered: April 2010
Junior Member
Hi Enrico, thanks for reply.

I would love to change the structure that way but unfortunately i can't.

Ich have to build a graphical editor for an existing XML-based language.
So, i can't change anything of the structure.

This non-nestet Elemets bothers me a lot and i have no idea how to represent these in a reasonable manner.

Re: Connection order [message #527523 is a reply to message #527470] Thu, 15 April 2010 13:58 Go to previous messageGo to next message
Enrico Schnepel is currently offline Enrico SchnepelFriend
Messages: 121
Registered: July 2009
Senior Member
Dennis,

comments below...

"Dennis" schrieb im Newsbeitrag news:hq6uk3$ret$1@build.eclipse.org...
> I would love to change the structure that way but unfortunately i can't.
>
> Ich have to build a graphical editor for an existing XML-based language.
> So, i can't change anything of the structure.
> This non-nestet Elemets bothers me a lot and i have no idea how to
> represent these in a reasonable manner.

I don't envy you...

I would create nested elements on the fly while reading the XML stream or
create them in a model-to-model transformation. On save vice versa.
Compartments can be really useful but there must be a mapping based on a
(containment) reference. Otherwise it might be easier to code GEF
directly...

Enrico
Re: Connection order [message #527540 is a reply to message #527523] Thu, 15 April 2010 14:39 Go to previous messageGo to next message
Dennis sui is currently offline Dennis suiFriend
Messages: 35
Registered: February 2010
Member
Currently i try to learn more about GEF programming.

What exactly do you mean with
Quote:

on the fly while reading the XML stream

?

where can I catch the XML parser actions?

Re: Connection order [message #527687 is a reply to message #527540] Fri, 16 April 2010 06:57 Go to previous messageGo to next message
Enrico Schnepel is currently offline Enrico SchnepelFriend
Messages: 121
Registered: July 2009
Senior Member
Hi Sui,

comments below.
"Sui" <suithedoc@arcor.de> schrieb im Newsbeitrag
news:hq78f6$gql$1@build.eclipse.org...
> Currently i try to learn more about GEF programming.
>
> What exactly do you mean with
> Quote:
>> on the fly while reading the XML stream
> ?
>
> where can I catch the XML parser actions?
I would ask this question on the EMF newsgroup...

It might be the more integrated way but using a model to model
transformation is much easier to implement. Personally I would use Xtend for
that job. the gmf editor needs to be created for the in-memory model. the
editor extension point needs to refer to the bad-xml-format-file and when
the editor loads the model you can create a new model dynamically by calling
your M2M.

I think it should work that way... Any comments from other GMF guys?

Enrico
Re: Connection order [message #527704 is a reply to message #527687] Fri, 16 April 2010 07:28 Go to previous messageGo to next message
Dennis sui is currently offline Dennis suiFriend
Messages: 35
Registered: February 2010
Member
ok, I will think about your suggestion.

The Problem is that I am running out of time and I have no experience in using MTM or Xtend.
I will spend this day on learning more about EMF-GEF-GMF. If I realize that this is a dead end I will try to apply your suggestion.

I will also ask the question about the XML parser in the EMF forum.
I thank you for your help in any case and I am open to any new ideas.
Re: Connection order [message #528382 is a reply to message #527704] Tue, 20 April 2010 10:44 Go to previous messageGo to next message
Dennis sui is currently offline Dennis suiFriend
Messages: 35
Registered: February 2010
Member
Hi,

after reading tons of documentation about EMF/GEF and serialisation I have still no idea how to solve the problem.

It might be the best solution to do a MTM transformation.
Since I am really new in this section, I have a few questions.

I read about ATL and QVT. What is the better solution to integrate it in an GMF-Editor?

I can't find a lot of information about QVT. Where is a good starting point?
The most interesting question is:

Can I use these tools to get what I want?
1. Create a second ecore model with nested elements and change it to the primary model on save.
2. Doing the opposite transformation by changing the file by myself.

Re: Connection order [message #528460 is a reply to message #528382] Tue, 20 April 2010 15:23 Go to previous message
Enrico Schnepel is currently offline Enrico SchnepelFriend
Messages: 121
Registered: July 2009
Senior Member
I know that one of both QVT dialects supports bidirectional mappings of
metamodel elements but there are a lot of restrictions regarding the bidi
mappings. The right place is to ask on the m2m newsgroup what you have
already done.

Enrico

"Sui" <suithedoc@arcor.de> schrieb im Newsbeitrag
news:hqk0j2$ugq$1@build.eclipse.org...
> Hi,
>
> after reading tons of documentation about EMF/GEF and serialisation I have
> still no idea how to solve the problem.
>
> It might be the best solution to do a MTM transformation.
> Since I am really new in this section, I have a few questions.
>
> I read about ATL and QVT. What is the better solution to integrate it in
> an GMF-Editor?
>
> I can't find a lot of information about QVT. Where is a good starting
> point?
> The most interesting question is:
>
> Can I use these tools to get what I want?
> 1. Create a second ecore model with nested elements and change it to the
> primary model on save.
> 2. Doing the opposite transformation by changing the file by myself.
>
>
Previous Topic:GMF reference editing
Next Topic:How to center EditParts in DiagramEditor ?
Goto Forum:
  


Current Time: Sun Sep 20 09:16:33 GMT 2020

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

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

Back to the top