Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Node Constraint Problem
Node Constraint Problem [message #219341] Thu, 19 February 2009 17:37 Go to next message
Maurice O'Connor is currently offline Maurice O'ConnorFriend
Messages: 86
Registered: July 2009
Member
Hi there! I've added an OCL constraint to one of my nodes in the mapping
model. I'd like to notify the user when the node has no name, so my
constraint looks like:

name.size() > 0

However, when I add the node to the diagram it the node simply disappears
(but the diagram is dirty). Validation and Live validation With UI
Feedback are enabled and Decorators too. I've tried adding an audit rule
with the same constraint also. A few questions:

1. Does Live validation just examine the audit rules?
2. How can I set it so when the user adds a node to the diagram and fails
to specify a name, the editor will complain, via decorator or message-box?

Thanks!

Maurice
Re: Node Constraint Problem [message #219404 is a reply to message #219341] Fri, 20 February 2009 10:53 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Maurice O'Connor,

> However, when I add the node to the diagram it the node simply
> disappears (but the diagram is dirty). Validation and Live validation
That's right - constraint is something more strict then the validation rule.

> 1. Does Live validation just examine the audit rules?
Should be this way.

> 2. How can I set it so when the user adds a node to the diagram and
> fails to specify a name, the editor will complain, via decorator or
> message-box?
Try using audits + generating the code + see if this code is ok for you.
I suppose you have to code something manually to get dialog displayed then
one of the audits was violated.

-----------------
Alex Shatalin
Re: Node Constraint Problem [message #219490 is a reply to message #219404] Fri, 20 February 2009 11:57 Go to previous message
Maurice O'Connor is currently offline Maurice O'ConnorFriend
Messages: 86
Registered: July 2009
Member
Thanks Alex, this is a help!

Maurice.

Alex Shatalin wrote:
> Hello Maurice O'Connor,

>> However, when I add the node to the diagram it the node simply
>> disappears (but the diagram is dirty). Validation and Live validation
> That's right - constraint is something more strict then the validation rule.

>> 1. Does Live validation just examine the audit rules?
> Should be this way.

>> 2. How can I set it so when the user adds a node to the diagram and
>> fails to specify a name, the editor will complain, via decorator or
>> message-box?
> Try using audits + generating the code + see if this code is ok for you.
> I suppose you have to code something manually to get dialog displayed then
> one of the audits was violated.
Previous Topic:Can't learn Eclipse GMF in 15 minutes
Next Topic:Practicalities of GMF
Goto Forum:
  


Current Time: Mon Apr 12 08:13:51 GMT 2021

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

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

Back to the top