Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » EVL constraints
EVL constraints [message #1059034] Thu, 16 May 2013 11:06 Go to next message
serhat gezgin is currently offline serhat gezgin
Messages: 240
Registered: January 2013
Location: Izmir
Senior Member
Hi all,

When i write this validation to my model;

	constraint doldur {
		
		guard : self.satisfies('IllegalCharactersForName')
		
		check {
			if(self.ownedField.select(f | f.name = "Text").size() <> 1){
				var text = new TextField;
				text.name = "Text";
				text.displayName = "Text";
				self.ownedField.add(text);
			}
		
			if(self.ownedField.excludes(text)){
					return false;
			}
			return true;
		}
		
		message : 'laaaa'
	}


i always get error (atached picture and txt file shows error)

But i need to create element from validation so how can i do this

anyone can help me ?

Regards
  • Attachment: EVLError.png
    (Size: 222.71KB, Downloaded 45 times)
  • Attachment: EVLError.txt
    (Size: 17.02KB, Downloaded 52 times)

[Updated on: Thu, 16 May 2013 11:08]

Report message to a moderator

Re: EVL constraints [message #1059421 is a reply to message #1059034] Sat, 18 May 2013 08:44 Go to previous message
Ralph Gerbig is currently offline Ralph Gerbig
Messages: 697
Registered: November 2009
Senior Member
Hi,

the check constraint of an EVL expression is there to check the model element as it is. I think what you should do is to offer a quick fix via evl. Maybe there you do not have a read only transaction.

Ralph
Previous Topic:Open diagram
Next Topic:Name of deleted Node
Goto Forum:
  


Current Time: Fri Oct 31 00:03:34 GMT 2014

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

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