Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » GMF and OCL interaction
GMF and OCL interaction [message #660920] Tue, 22 March 2011 11:19 Go to next message
Darie Moldovan is currently offline Darie MoldovanFriend
Messages: 67
Registered: November 2010
Location: Darmstadt, Germany
Member
Hello,

I am posting this message in both the GMF and OCL sections, because this topic might be interesting in both of them.

Do you happen to know any OCL editor which can interact with GMF elements?

Example: write a query in the OCL console view and, if the result contains an element from the GMF diagram, then automatically select (highlight) that resulted element in the diagram. This is what I am trying to do and do not have any ideas where to start. There should be a trick on how to manipulate the AST from OCL, maybe you can give me a clue.

Thanks in advance.

Later edit: please take a look at Figure 5 from this article. Let's say we want to write an OCL query which returnes all the "Skill" elements of the company. We would probably write <b>Skill.allInstances()</b> in the OCL console and would get as a result 2 Skill-objects, namely <i>modelling</i> and <i>hacking</i>. Is there a way to automatically highlight/select these returned objects in the generic editor? Or, just think you would make an OCL query on a GMF diagram - the question stands. Is it possible to manipulate the instances of the objects, which are returned by an OCL query in the OCL console? If yes, what kind of approach would you recommend?

[Updated on: Tue, 17 January 2012 14:47]

Report message to a moderator

Re: GMF and OCL interaction [message #661007 is a reply to message #660920] Tue, 22 March 2011 15:45 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
On 22-03-11 04:19, Darie wrote:
> Hello,
>
> I am posting this message in both the GMF and OCL sections, because this
> topic might be interesting in both of them.
>
> Do you happen to know any OCL editor which can interact with GMF elements?
>
> Example: write a query in the OCL console view and, if the result
> contains an element from the GMF diagram, then automatically select
> (highlight) that resulted element in the diagram. This is what I am
> trying to do and do not have any ideas where to start.

Is it correct you want to select the result of the OCL evaluation in the
GMF diagram? This would be a two step process. 1. Get the object from
the OCL evaluation. 2. Select the corresponding shapes in the diagram.

1. The trick would be to hook-in to the OCL console (As by design the
result of the OCL evaluation is emmitted to the console) and feed the
GMF elementSelectionProviders with the result of the evaluation.

2. This is a bit tricky, but you could hookin to the Selection
Synchronizer. (See some recent posts on this). Or you could have a look
at the elementSelectionService build into the GMF runtime.

(More info on the selection provider here:
plugin->extensions->add...->elementSelectionProviders)

There should be a
> trick on how to manipulate the AST from OCL, maybe you can give me a clue.
Don't you just want the result of the evalution? The AST is a
non-evaluated representation of the OCL expression.
>
> Thanks in advance.
Re: GMF and OCL interaction [message #661322 is a reply to message #661007] Thu, 24 March 2011 08:58 Go to previous messageGo to next message
Darie Moldovan is currently offline Darie MoldovanFriend
Messages: 67
Registered: November 2010
Location: Darmstadt, Germany
Member
Hi Cristophe,

thank you for your time. Please also refer to this topic. Ed Wilink also gave me some ideas on how to implement this feature.

I'll also have to take a look at the Selection Synchronizer, thanks for the tip.

Regards,

Darie
Re: GMF and OCL interaction [message #661412 is a reply to message #661322] Thu, 24 March 2011 14:52 Go to previous messageGo to next message
Darie Moldovan is currently offline Darie MoldovanFriend
Messages: 67
Registered: November 2010
Location: Darmstadt, Germany
Member
Hi again,

I solved my problem. The solution can be found here.

Regards,

Darie
Re: GMF and OCL interaction [message #661463 is a reply to message #661322] Thu, 24 March 2011 18:03 Go to previous messageGo to next message
Christophe Bouhier is currently offline Christophe BouhierFriend
Messages: 937
Registered: July 2009
Senior Member
OK, I missed that thread. It's probably better to address both
newsgroups with a single thread.

On 24-03-11 01:58, Darie wrote:
> Hi Cristophe,
>
> thank you for your time. Please also refer to
> http://www.eclipse.org/forums/index.php?t=msg&th=206451& amp;start=0&S=db7f7e86c211b99c568cd4f192d0d793
> Ed Wilink also gave me some ideas on how to implement this feature.
>
> I'll also have to take a look at the Selection Synchronizer, thanks for
> the tip.
>
> Regards,
> Darie
Re: GMF and OCL interaction [message #780285 is a reply to message #660920] Tue, 17 January 2012 14:29 Go to previous messageGo to next message
Philipp Kutter is currently offline Philipp KutterFriend
Messages: 306
Registered: July 2009
Senior Member
Hi, Darie.
The GMF Tooling project right now does invest heavily in using OCL to
define the editor behavior in various places.

They mainly focus on performance, ease of maintenance and debugability
of the notifications during runtime.

Your topic focuses on finding out whether the OCL is correct. I think
the GMF Tooling team would be very interested to hear more what you are
doing, and maybe it could be committed to the project.

Can you contact them on the newsgroup, or send them a note directly.

The email addresses are
golubev@montages.com,
hillairet@montages.com,
kovalsky@montages.com

Regards, Philipp

On 22.03.2011 12:19, Darie wrote:
> Hello,
>
> I am posting this message in both the GMF and OCL sections, because this
> topic might be interesting in both of them.
>
> Do you happen to know any OCL editor which can interact with GMF elements?
>
> Example: write a query in the OCL console view and, if the result
> contains an element from the GMF diagram, then automatically select
> (highlight) that resulted element in the diagram. This is what I am
> trying to do and do not have any ideas where to start. There should be a
> trick on how to manipulate the AST from OCL, maybe you can give me a clue.
>
> Thanks in advance.
Re: GMF and OCL interaction [message #780290 is a reply to message #780285] Tue, 17 January 2012 14:43 Go to previous message
Darie Moldovan is currently offline Darie MoldovanFriend
Messages: 67
Registered: November 2010
Location: Darmstadt, Germany
Member
Hi Philipp,

as the idea described above is part of a research project, it would be theoretically possible to contribute the code to the GMF tooling team. But first I have to talk to those people who had the idea at first, I was just implementing it.

As I commented above, the trick was to be able to interact between the OCL console and a GMF editor. The console itself is nice, but a simple text result doesn't help much. Selecting the resulted elements in the diagram is more user-friendly.

So, if it is possible to contribute the code, I'll be glad to do it.

Best regards,

Darie
Previous Topic:Is the Tooling Project Dead?
Next Topic:Synchronize Xtext and GMF editors
Goto Forum:
  


Current Time: Fri Apr 26 05:12:25 GMT 2024

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

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

Back to the top