Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » I need validation , OCL doesn`t work.I can do that in Java?
I need validation , OCL doesn`t work.I can do that in Java? [message #196357] Wed, 09 July 2008 19:32 Go to next message
Eclipse UserFriend
Originally posted by: yo.davidm.gmail.com

I have my own EdataType and OCL doesnt work . I think that I can implement
validation in java (http://wiki.eclipse.org/GMF_Constraints#Java).
Where I find information?, I dont know where I put de java code etc...


Thanks
Re: I need validation , OCL doesn`t work.I can do that in Java? [message #196453 is a reply to message #196357] Thu, 10 July 2008 09:35 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello David,

Juva constraints are self-descriptive. Add this kind of constraint, generate
code and see what was changed - you should get additional method wich to
put actual java imlementation into...

-----------------
Alex Shatalin
Re: I need validation , OCL doesn`t work.I can do that in Java? [message #196468 is a reply to message #196453] Thu, 10 July 2008 10:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: yo.davidm.gmail.com

Hi Alex sorry but I dont understand....

I should create a constraint such as:

if (this.value<>false)
return false;

And later i create generator model? Or I should generate model code?.Where
I should modify later the Java code? In MyProjectFolder or in
MyProject.diagramFolder.


Thank you very much for expent your time at this Alex.

Regards
Re: I need validation , OCL doesn`t work.I can do that in Java? [message #196474 is a reply to message #196468] Thu, 10 July 2008 11:46 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello David,

- open .gmfmap file editor
- explore model and locate appropriate Node/Link mapping
- create new constraint to be used as a "domain specialization"
- set language = java
- regenerate .gmfgen model
- regenerate code
- open generated ???VisualIdRegistry.isYYY() method and modify it.

BTW, in OCL this constraint can be written simply like: "not self.value"

-----------------
Alex Shatalin
Re: I need validation , OCL doesn`t work.I can do that in Java? [message #196518 is a reply to message #196474] Thu, 10 July 2008 16:11 Go to previous message
Eclipse UserFriend
Originally posted by: yo.davidm.gmail.com

Hi Alex thank you !!!

I know this "in OCL this constraint can be written simply like: "not
self.value""; the problem is that I have my own EdataType ( I comment on
http://www.eclipse.org/newsportal/article.php?id=13899&g roup=eclipse.modeling.gmf#13899)
and OCL parser dont work with that.
I have managed to implement the method, thank you!!

Best regards.
Previous Topic:compartment resize ratio
Next Topic:top container name
Goto Forum:
  


Current Time: Sat Jun 06 11:58:12 GMT 2020

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

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

Back to the top