A Quality Rule Model can be used to check that an Application adheres to a specific rule - this can be checked directly in the Architecture Studio. In addition to this, Quality Rule Models can be published and made available for all Applications managed in AIP Console which will automatically make them available as a custom extension in the Available Extensions GUI. The custom extension can then be included in an analysis and the rule in the extension will be checked during the next analysis (results are made available in the CAST Dashboards like for standard CAST rules). This page explains how to publish the Quality Rule Model as an extension and re-use it in an analysis.
Publishing the model
Publication consists of:
- creating an installable extension from the Quality Rule Model
- making the extension available to all Nodes so that it is visible in the Available Extensions GUI for any application.
You can then decide whether to include and install this extension in your application(s).
Step 1 - Define the model properties
Before you can publish Quality Rule Model as an extension, you will need to define some properties for this model. To do so, edit the model you want to publish:
Now click the Model Properties option in the editor:
You should then ensure that the following properties are defined - see AIP Console - Architecture Studio - Model editor for more information about each property. Any missing properties will cause the publication process to fail:
- Model > Metric ID
- Model > Name
- Model > Description
- Documentation > All fields to be filled except Remediation Sample
- Technical Criteria > At least one technical criteria needs to be selected to position the rule correctly in the Assessment Model
Note that it is not mandatory to define:
- Technologies > if you do not define specific technologies for your rule, the rule will be triggered regardless of the technologies that are being analyzed, therefore potentially impacting performance of the analysis
- Grade Thresholds > A default set of thresholds will be used, but you can modify these if you wish
Click Update to save the properties, then save the model itself:
Finally, close the model editor:
Step 2 - Publication
Click the Publish button for the model you want to publish:
The publication process then begins. If any errors are found in the model, for example properties not filled in or an empty scope set in the model, then the publication will fail. A message is displayed in the bottom left corner of the screen, detailing the error (in this case you will need to resolve the error, usually by filling in the missing properties):
Note that during the publication process, a metamodel check is actioned to ensure that the rule in the resulting extension is coherent. More precisely, this check will look to see if the model uses a metamodel type/property (i.e. in the "Scope" set) which is not defined in the application metamodel - if a type/property like this is found, then the publication will be blocked. This could occur in the following example situation:
- You create a Quality Rule model that uses types/properties from a specific technology extension (and which only exist in this specific technology extension) in the model itself, i.e. in the Scope set.
- You set the Context of the model to an Application that does not use this specific technology extension
- When you attempt to publish the model, the metamodel check will discover that the types/properties that you have specified in the model do not exist in the Application's metamodel (because the extension is not installed) and the publication will fail.
Therefore you must ensure that you set the Context correctly before publication, particularly if you are using types/properties in the model from a specific technology extension:
A successful publication is displayed on the screen as follows:
The publication date is listed in the list of models:
The first publication of the model as an extension will use the following version number:
When you re-publish the model and AIP Console determines that the model has changed, then the second digit will increment and a new extension will be created, for example:
Step 3 - Use your model in an Application analysis
When your extension has been published, you can use it in any Application during the next analysis/snapshot that you run. To do so, click AIP Console from the context switcher on the toolbar:
Click the relevant application:
Move to the Application - Extensions section and click the Available tab:
You should see your extension listed - use the search box to filter the list of extensions if you cannot see it immediately. Then choose the appropriate version to use and click Include. The extension will be used in the next analysis/snapshot:
When an extension has been installed (i.e. an analysis/snapshot has been run), you will be able to see your rule in the AIP Assessment Model under the chosen Technical Criterion:
Re-editing the model and re-publication
If you edit the model, make a change and then save the model, AIP Console will detect that the model has been modified:
You can now publish the extension again. As explained above a new extension will be generated with a new version number. This extension will then be available for use at Application level - you will need to select the extension in Application - Extensions, click Include and run a new analysis/snapshot before the results can be viewed in the CAST Dashboards.