|
|
|
|
|
Re: how the gmf editor supports a constraint in the ecore model [message #756447 is a reply to message #756401] |
Sun, 13 November 2011 12:20 |
|
Hi Patricia,
Using the latest version of GMF Tooling (2.1.0.v20110607-2359) / Epsilon 0.9.1 I'm not able to generate a GMF editor from KAOS.emf as I'm getting a long list of validation errors on the produced .gmfgen. I can generate editors from other .emf files so there seems to be some issue specific to this one - which I need to investigate further. Could you please let me know which versions of Epsilon/GMF you're using?
In the mean time I'd suggest removing all OCL-related bits from your .emf file and regenerating the editor.
Cheers,
Dimitris
|
|
|
|
Re: how the gmf editor supports a constraint in the ecore model [message #759476 is a reply to message #756326] |
Mon, 28 November 2011 19:14 |
Paulo Alexandre Messages: 17 Registered: November 2011 |
Junior Member |
|
|
Hi, Patricia
I think I can help you. Please, see this simple emf meta model.
@namespace(uri="family", prefix="family")
package family;
@gmf.diagram(foo="bar")
class Parents
{
val Father[*] fathers;
val Mother[*] mothers;
}
@gmf.node(label="name")
class Father{
attr String name;
}
@gmf.node(label="name")
class Mother{
attr String name;
}
If you create a gmf Editor (a new eclipse instance) and Click Edit->Validate nothing will show up. But if you change the property 'name' in this way
attr String name; --> attr String[1] name;
the property 'name' will be automatically mandatory. So, in gmf editor (new eclipse instance) if the property 'name' is not set and if you click Edit->Validate you'll get an error like this: <<The required feature 'name' of '<Parents>::<Father>' must be set>>
Anyway, I followed the tutorial Dimitrius has talked about. Actually, I didn't need to perform all the actions described there. All I needed to do was:
Having written the constraints, the next step is to bind them to the GMF editor. To do this, we switch to the Extensions tab of MANIFEST.MF and add the org.eclipse.epsilon.evl.emf.validation extension. Then we right-click it and add a new constraintBinding. In thenamespaceURI field of the extension we set the value to <<name of your package>> and in the constraints field we select the <<file .evl which contains the constraints>> EVL file we created in Step 3.
In any case, just let us know if you were successfull, ok ?
|
|
|
Powered by
FUDForum. Page generated in 0.03968 seconds