i'm trying to develop a UML validator plugin to create and validate contraints for a certain UML profile.
As a total beginner with eclipse plugin technology and emf in general and thus I'm very confused. So I've decided to start from the org.eclipse.emf.validation.examples.general example to see what I can get.
What I need is a button (or a method to override the "Validate" button in the UML editor) which allows me to do some constraint checks for my particular UML profile. For simplicity, at the moment it's enough that I succeed in validate a plain UML model without a profile.
Unfortunately I'm not succeeded in the modification of such example, as I get a button "Validation_1" in the menu of UML editor which doesn't call the constraint I've defined.
The steps of my modification are described as follows:
1- in the plugin.xml I've added (I know that it's not what I want since in this way I get a menu and a button but it's not a big problem now)
3- in the file "BatchValidationDelegate.java" I've modified the type of the type of the editor reference from "EXTLibraryEditor" to "UMLEditor" (and the relative cast in the "setActiveEditor" method)
4- in the definition of the example of constraint in "NonEmptyNamesConstraint.java" I've just added a debug message to see if whenever I press the "Validation_1" button I get the message in the console (with the line "ConsoleUtil.printError("DEBUG", "Constraint Processing");")
When I start the example as an eclipse plugin and I press the Validation_1 button the message "Constraint Processing" doesn't not appear even if the action of the button (BatchValidationDelegate) is called correctly. It seems I've missed something in the ragistration of the constraint for the UML model but I can't see other places to modify in order to get the example working.
Vlad Varnica Messages: 546 Registered: July 2009 Location: Milton Keynes - UK
I was reading your post and tried to add a constraints at metamodel level directly. The model validation is successful. For me the problem is during the transformation stage.
This is not therefore a UML tools question but more related to EMF transformation, I think :roll:
As I always say" The best transformation is no TRANSFORMATION at ALL"
Concerning Profiles using stereotypes and constraints please not that if you were working at metamodel level this project would be finished in one day. You just need to create a profile and extend the property to your project.
It immediately works 8o