blob: 86eec23e7f395b7f62857e90e14ff3e1ccfb75cb [file] [log] [blame]
context EClass {
-- Dummy constraint to demonstrate the capabilities of EVL
constraint Unamed {
check : self.name.isDefined()
message : 'Unnamed class'
fix {
title : 'Create another one'
do {
var eClass = new EClass;
eClass.name = 'foo';
self.eContainer().eClassifiers.add(eClass);
}
}
}
critique NameStartsWithCapital {
guard : self.satisfies('Unamed')
check {
var nameToUpperCase = self.name.firstToUpperCase();
return nameToUpperCase = self.name;
}
message : 'Class ' + self.name +
' should start with an upper-case letter'
fix {
title : 'Rename to ' +
self.name.firstToUpperCase()
do {
self.name := self.name.firstToUpperCase();
}
}
}
}