Overview
Overview of Rules
Rules consist of code that is written in Visual Basic.Net (VB.Net), a programming language that is compatible with the language in which APM is written. If you have sufficient knowledge of writing VB.Net code, you can write rule code to be executed when certain changes occur in the APM database. You can write family-level or field-level rules.
As an alternative to family-level rules, you can use family policies to configure certain actions to occur when a record changes in the APM database. Family policies are created in a user interface where knowledge of Visual Basic.Net (VB.Net) is not required.
Rules Workflow
This workflow provides the basic, high-level steps for using this module. The steps and links in this workflow do not necessarily reference every possible procedure.
- If you want to configure a family-level rule for a family, specify in Configuration Manager that family-level rules should be used for that family.
- Open the Rules Editor, and then access either a family rule project or the Rules Library.
- If you accessed the Rules Library, then you can add a folder to the library.
- Create a new Rules Library rule project.
- Add a reference to the project.
About Family Rule Projects
A family rule project is an organizational unit that provides the coding infrastructure within which the rules for that family will be written and stored.
- For baseline families, a family rule project exists for any family for which family-level or field-level rules have been defined within that specific family. For baseline subfamilies that inherit all their behaviors from higher-level families, a family rule project will not exist.
- For custom families, the family rule project is created the first time that you access the family-level or field-level rules for the family.
More Details
Family rules can be viewed and managed in the APM Rules Editor. When you open the rule project for a family, the family rule project will be selected by default. Below the project name is a list of all the items that are currently included in the project.
By default, the content of the project will consist of references and files. Each family rule project contains a file for the family itself and a file for each field within the family. A file will be created for each field that is defined directly within that family and each field that is spread down from a family where the field can be customized at the sublevel.
As you add fields to a family, new files will be added to the family rule project. You can select any file to view and modify the code that is stored within it.
Within each file, a class is defined for the corresponding family or field. Each class serves as the organizational unit within which actual family-level and field-level customization code exists. The name of the file matches the name of the class defined within it, which in turn corresponds to the field ID or family ID (i.e., not the family or field caption).
You can open multiple rule projects at a time. When you do so, each rule project will appear as a root-level entry in the Solution Explorer pane.
When you access the family rule project for a baseline APM family, the corresponding baseline Rules Library project will also appear in the Solution Explorer pane. The baseline Rules Library project has the same name as the family rule project with _Base appended to it.
You cannot modify the baseline Rules Library project, but it is displayed so that you can easily view and debug the baseline rule code to understand the baseline family and field rules.
Configure a Family to Use Family-Level Rules
About This Task
If you want to configure a family-level rule for a family, you first must specify in Configuration Manager that family-level rules should be used for that family.
Procedure
What To Do Next
Access the APM Rules Editor
Before You Begin
If you want to configure a family-level rule for a family, specify in Configuration Manager that family-level rules should be used for that family.