Skip to main content


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 gezginFriend
Messages: 243
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 156 times)
  • Attachment: EVLError.txt
    (Size: 17.02KB, Downloaded 270 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 GerbigFriend
Messages: 702
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 Apr 26 02:58:49 GMT 2024

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

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

Back to the top