Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » How suitable is Graphiti for a visual expression builder?(Can you use Graphiti to create a visual expression builder)
How suitable is Graphiti for a visual expression builder? [message #1705942] Thu, 20 August 2015 10:09 Go to next message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member

I need to create a visual expression builder that will create groovy source code underlying. It is based on taking an input record with fields, a map into a transformation which also can have exception objects and cache objects associated with it and map the input fields to fields in an output record. I have a set of classes in emf that represent all of these. The expression can change/inject output field values or raise exceptions.

I would have to add parenthese , 'if', 'else if', 'else', comparison operators (e.g. '>=', '!='. '==' etc.) and an assigment operator ( '=') into my model so all visual elements have an underlying emf class I assume.

Another important aspect is enforcing layout. Any opening parenthese DnD onto the design surface forces the next element to be indented and the next 'line' down. Similarly a closing parenthese is always moved to the next 'line' down and the indent is reduced. DnD an opening parenthese into an expression will cause all following 'lines' to indent.

The purpose is to allow users with no script training to apply logic using a very limited set of operations.

But I'd need the visual model to enforce syntax correctness and I am not sure this is possible with Graphiti. For example the user might DnD a field from a palette of input fields onto the design surface directly after a closing parenthese . This is invalid syntax and I am not sure if Graphiti can enforce this ordering? Valid syntax in this case would allow an opening parenthese , a 'if' statement or a directive such as setting an output field value to a cache value or input field value. It appears that Graphiti is more geared towards class modelling than procedural logic modelling.

So is it a good idea to base such an editor on Graphiti?

[Updated on: Thu, 20 August 2015 10:23]

Report message to a moderator

Re: How suitable is Graphiti for a visual expression builder? [message #1705953 is a reply to message #1705942] Thu, 20 August 2015 11:50 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1885
Registered: July 2009
Location: Walldorf, Germany
Senior Member

from the pure diagram aspect of it this sounds somewhat similar to a kind of
BPMN modeler. From that I don't see any argument why not using Graphiti for

Enforcing the correct syntax of expressions cannot be done by Graphiti
itself. This must be part of your tooling layer that connects the Graphiti
diagram with your domain objects (e.g. statement, directive ...). There
needs to be some kind of systax check that validates all of the rules and
reports back any kind of warnings, errors and the like. These errors can
then displayed as decorators on top of the Graphiti diagram elements, as
problem markers in the problems view or however you would like. I guess this
validation needs to be implemented for any kind of graphics framework you

Previous Topic:Multiple DomainObjects per Pictogram
Next Topic:Graphiti Inactive Shapes
Goto Forum:

Current Time: Wed Mar 21 13:15:29 GMT 2018

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

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