Java Reference
In-Depth Information
Validate menu item to run the audit. The
second audit detects invalid Topic names, which, in this case, are limited to
empty name strings and those that are not initialized. A more elaborate audit
could be created to ensure that valid Topic names are entered. The severity is set
to error and the audit is defined as a “live” audit. This means that it will be
invoked automatically when changes are made to the specified domain element.
As you'll see in the generator model, an additional option is available to provide
immediate UI feedback: A dialog will pop up to alert the Practitioner that the
change made violates a constraint.
Moving to metric definitions, right-click the Mapping node again and add a
child Metric Container element. Populate the container with the elements
and property settings in Table 4-10.
must manually invoke the Diagram
Table 4-10
Mindmap Metric Definition
Element
Property
Value
Mapping
Metric Container
Metric Rule
Description
The number of direct subtopics for the selected
Topic
High Limit
5.0
Key
NOS
Low Limit
0.0
Name
Number of Subtopics
Value Expression
Body
self.subtopics->size()
Language
ocl
Domain Element Target
Element
Topic -> MapElement
Metrics are defined with upper and lower limits and are based on the result
of the OCL statement. In this case, we're counting the number of direct subtopics
of a Topic . We could define another that counts the total number of subtopics
using the closure() iterator we used earlier.
At this point, we can re-create our mindmap.gmfgen model from the map-
ping model and observe new Gen Audit Root and Gen Metric Container
elements. More interesting are the options related to validation in the Gen
Diagram element. Under the Diagram category are the Validation Enabled
and Validation Decorators properties that we set to true here. Also notice
Search WWH ::




Custom Search