Pattern Overview
Patterns are the main declarations in the pattern language. They are used to describe the structures of applications, products and other modeled entities, and encapsulate rules about how to identify them. The following sections provide descriptions of the various features of patterns:
Pattern declarations
Pattern declarations have the form:
pattern name version
description
[metadata
metadata_entries
end metadata;]
overview
overview_entries
end overview;
[constants
constant_definitions
end constants;]
triggers
trigger_definitions
end triggers;
body
body_details
end body;
[removal
removal_condition
removal_details
end removal;]
end pattern;
The name, version and description are mandatory, for example:
pattern Xvnc 1.0
"""
X VNC server pattern.
Creates one SoftwareInstance per running VNC server.
"""
...
Pattern version numbers
It is very important that pattern version numbers are correctly specified, so as to avoid unexpected results in the model. Whenever a pattern is modified, its version number should be incremented. If the modification does not change the structure of any data constructed by the pattern, or only non-standard node attributes are changed, the pattern's minor version number should be incremented; if the structure of the model constructed is changed, the major version should be incremented. In particular, if the key attributes of any maintained nodes are changed, the pattern's major version must be incremented.
When a new version of a pattern is uploaded into BMC Discovery, nodes maintained by the previous version can be affected. On minor pattern version updates, the new pattern becomes the maintainer for the nodes. On a major version update, nodes maintained by the previous version continue to be maintained by the previous pattern; when the older pattern is removed, the nodes it is maintaining are destroyed.
Overview section
The overview is required. It contains information about the pattern and the entities it creates. It must contain a tags
entry, and can have optional overrides
and requires
entries.
Tags
tags tag_name [ , tag_name ... ];
Declares tags relating to the pattern. At least one tag must be present. See the section on tags.
Overrides
overrides pattern_name [ , pattern_name ... ];
Indicates that the pattern overrides one or more other patterns. In that case, the override pattern changes the behavior of an original pattern.
The named pattern must be previously declared in the file, either with a pattern declaration, or via an import. It makes little sense to override a pattern in the same file, so usually the overridden pattern will be imported. This functionality is used to modify standard BMC-produced patterns in the field.
It is not an error to name a non-existent pattern in an overrides clause.
Since other patterns might rely on the behavior of the overridden pattern, the overriding pattern should take care to construct the same form of data model as the overridden pattern.
Requires
requires pattern_name [ , pattern_name ... ];
Declares that this pattern requires the effects of the other named pattern in some way.
The named pattern must be previously declared in the file, either with a pattern declaration, or via an import. It is most useful to declare requirements for patterns in other files, so usually the required pattern will be imported.
Comments
Log in or register to comment.