Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Live mode constraint not working correctly
Live mode constraint not working correctly [message #32393] Tue, 29 August 2006 03:24 Go to next message
Eclipse UserFriend
Hi,
I have two questions:
1)AFAIU, the difference between constraints under Node/Link Mapping
element and constraints in Audit Container is that the former controls
whether a node/link can be created, and the latter checks whether the
existing model is semantically correct?

2)I created a simple constraint(checks whether name's length is greater
than 2) in Audit Container, it works fine in batch mode, but when I
switched it to live mode, there seems to be some problem. For example, I
can get warning decorator when I enter name in properties view, but can
not get it by direct editing. I wonder that in live mode, for which
situations would the constraint be checked?
Re: Live mode constraint not working correctly [message #32706 is a reply to message #32393] Tue, 29 August 2006 07:35 Go to previous message
Eclipse UserFriend
Hi zhanghao,

See comments bellow.
Regards,
/Radek

"zhanghao" <bjzhanghao@21cn.com> wrote in message
news:d89144b3c6d1a11e0ce12168dc7dec04$1@www.eclipse.org...
> Hi,
> I have two questions:
> 1)AFAIU, the difference between constraints under Node/Link Mapping
> element and constraints in Audit Container is that the former controls
> whether a node/link can be created, and the latter checks whether the
> existing model is semantically correct?
>
Correct. Just to add more on this, audits have identity, description,
severity and mode.
They also can be enabled/disabled in the central constraint registry.
As you have mentioned, they can be used to check semantical correctness but
also
for promoting best style/practices of diagraming. A model can be
semantically correct
but the user can still be warned about too many child nodes, links,
unconnected nodes etc.

While audits check the current (already modified) state of targeted
elements, link constraints check
the connection participants in the state before they are connected.
Link constraints should assist the user in correct diagram editing if he/she
attempt to connect
undesired nodes together. This could either fail in the end of the
transaction due to live
constraints violation (if any exist) or produce invalid model state.
The model integrity aspect is best to be guarded as a model constraint, for
instance to cover
the case when a link is created from the properties view.
However, it can be useful to give a hint to the user in advance if there is
no way to drop the connection
end currently being dragged, instead of getting Tx rollback and starting
from the scratch.

> 2)I created a simple constraint(checks whether name's length is greater
> than 2) in Audit Container, it works fine in batch mode, but when I
> switched it to live mode, there seems to be some problem. For example, I
> can get warning decorator when I enter name in properties view, but can
> not get it by direct editing. I wonder that in live mode, for which
> situations would the constraint be checked?
>

Live constraints are checked every time their targeted element's
modification is to be commited or
GMF editor (Batch) Validation action is executed (IBatchValidator is run in
includeLiveConstraints = true).
The validation status decorators get updated only after validation execution
and should be in sync with the validation problem markers.
So it looks like in your case the decorator is displayed only based on an
existing marker after refresh,
which perhaps is not performed after direct editing.
Previous Topic:Validation Problem
Next Topic:Exception when deleting node
Goto Forum:
  


Current Time: Tue May 06 00:06:14 EDT 2025

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

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

Back to the top