Releases: Zeta-Project/zeta
Releases · Zeta-Project/zeta
Release v2.0
First release of the ModelValidator
The ModelValidator functionality lets you validate a model against the constraints which are specified by the meta model.
The graphical editor just can check a few easy-to-check constraints. More complex ones won't get highlighted in the graphical model. Using the model validator functionality, you can generate a validator for a existing meta model, and check a model against this validator afterwards. Every constraint the meta model can specify will be checked (such as upper and lower bounds, unique attributes or valid edges between nodes).
There are three ways to call the generator and validator:
- Inside the graphical model editor, you'll see a new dropdown validate, where you can generate a validator and validate the current model against it. The validation results will be shown textually inside a new browser window. Additionaly, invalid model elements will be highlighted directly inside the graphical model.
- In the overview of the meta models and models, you can generate the validator and validate models. To generate the validator, use the dropdown menu under the meta model and click Generate / Update Validator. Afterwards, you can use the "thumbs up" symbol behind a model to validate it. The results will be shown textually inside a new browser window.
- You can use the REST-API directly. To generate a validator, call the route
GET /metamodels/{metaModelId}/validator
using the parametergenerate=true
. If you just want the validator to be generated without the generated validator being returned, you can additionaly use the parameternoContent=true
. For example:http://localhost:9000/metamodels/abc123/validator?generate=true&noContent=true
To validate a model against the generated validator, call the routeGET /models/{modelId}/validation
. The result will be a JSON with following contents:
[
{
"element" : {
"id" : "the element's id",
"type" : "node" | "edge",
"typeName" : "the meta element's name"
},
"rule" : {
"name" : "the rule's name",
"description" : "the rule's description",
"possibleFix" : "a possible fix for invalid elements"
},
"valid": true | false
},
...
]