To modify and create rules, you must understand the following terminology and concepts:
A rule project is a container for rule code. GE Digital APM uses two types of rule projects:
Rule projects contain references and files, also called code items. The files contain rules that are defined for that project. The file structure for family projects is determined by the content of the family. The file structure of a Rules Library project is determined by the project owner and can be customized as necessary to meet the requirements of the project.
A class is a VB.Net element that serves as a container for storing objects. Classes are defined within the files that exist in a rule project.
Any VB.Net class can be inherited from another class so that the rules defined in one class can be reused as often as needed.
The following code excerpt shows an example of the default class Class1 that is created when you create a new Rules Library project:
Option Strict On
Option Explicit On
Imports Meridium.Core.DataManager
Imports Meridium.Core.DataManager.Customization
Imports Meridium.Core.Internals
Imports Meridium.Core.Metadata
Imports Meridium.Core.Security.ApplicationUser
Imports Meridium.Core.Uom
Imports System
Imports System.Xml
Public Class Class1
Private Sub New()
MyBase.New
'
'TODO: Add constructor logic here
'
End Sub
End Class
In this example, the lines Public Class Class1 and End Class define the class; the code in between these two lines of text represents all the objects that belong to the class.
A function is a block of rule code that defines a Function procedure. Functions can be defined to invoke specific behaviors. The standard field-level rules that are available in GE Digital APM are defined through functions. In the following example, the IsRequired function is between the two lines Public Class Class1 and End Class.
Option Strict On
Option Explicit On
Imports Meridium.Core.DataManager
Imports Meridium.Core.DataManager.Customization
Imports Meridium.Core.Internals
Imports Meridium.Core.Metadata
Imports Meridium.Core.Security.ApplicationUser
Imports Meridium.Core.Uom
Imports System
Imports System.Xml
Public Class Class1
Public Overrides Function IsRequired() As Boolean
Return True
End Function
End Class
Inheritance allows one class to use the behaviors defined in another class.
All the functions and behaviors defined in the base class are automatically applied to the derived class. Within the derived class, code can be written to extend or override specific functions defined in the base class. Inheritance allows you to create new classes based on existing classes and is an important component of the Rules Library and baseline rule storage.
Inheritance is achieved through an Inherits statement in the derived class. For instance, in the following example, the class MI_RCA_ANALY_COST_NBR (the derived class) inherits the class EntityFieldCustomization (the base class).
Public Class MI_RCA_ANALY_COST_NBR
Inherits EntityFieldCustomization
End Class
Copyright © 2018 General Electric Company. All rights reserved.