Class form
|
Use the General tab to define the class inheritance and database access.
After you first save this form, your entries for many fields in this tab are permanently set and cannot be changed later. However, the Keys array is an exception. if you save the form with the Keys array blank, you can update the Class form later and complete Keys array to reference properties that are defined to apply to this class.
How the system forms key values from the properties in the Keys array
Every object saved to the PegaRULES database — that is, every instance of a concrete class — must have a key formed from the value of properties that is unique within the class or class group.
For example, your system cannot contain two instances of the Data-Admin-Operator-ID class with an ID value of [email protected]. Similarly, your system cannot contain two HTML fragment rules named MyFragment in the same RuleSet and version.
The properties that form the key may apply to the concrete class itself or to a parent class. (For rule instances, the RuleSet and version are appended as part of the internal key.)
Process Commander looks in three places to learn which property values, in what order, to concatenate to form the unique key. The system assembles keys the first time it saves an instance:
Completing the Settings fields
The appearance of the General tab changes depending on whether you enter a class group, keys, or neither. You cannot enter both a class group and keys. If you enter a class group, Process Commander uses keys defined in the class group.
When you save the Class form, most of the choices you made become permanent. For example, you cannot later select or clear the Find by name first (Pattern)? box to use, and you cannot change properties entered in the Keys array.
Field |
Description |
Select |
Indicate whether this class is to be abstract or concrete. Both abstract and concrete classes can have subclasses. If this class is to have persistent instances,
select Otherwise select |
Settings | |
Created
in Version |
Identify the RuleSet version number that applies to this class. The Archive tools depend on the version you enter here. The Export Archive tool includes this class instance if you export this RuleSet version or a higher-numbered version. However, version information in class rules is not used for rule resolution. You cannot define multiple class rules with the same class name but different versions. Complete this field when first creating a new class (with New or Save as). Alter this field later in rare circumstances only. |
This Class |
Select one:
As a best practice, choose
If you create a
class is derived from the Work- base
class, and you selected
For an external
class created through the External Data Table wizard,
the initial value is |
Encrypt BLOB? |
Select to cause Process Commander to encrypt the Storage Stream of each instance of this concrete class when saved to the PegaRULES database, and to decrypt the Storage Stream when an instance is retrieved from the database. This check box appears only for concrete classes. It affects only instances of exactly this class, not instances of any subclasses of this class. Determine whether you application is to use this feature early during the development project. You can't check, or clear, this box if the database already contains instances of the class. Additional configuration is required to set up this capability. See Working with the PegaRULES database — How to enable encryption of the Storage Stream. |
This field appears only when is a class group
or belongs to a class group
is selected in the
This class field. Confirm that the class
group identified is the one expected.
Field |
Description |
Class Group |
Optional. If you
selected The name of the class group you choose must match an initial portion of the class name. Choose this option when defining one or several concrete classes that define types of work objects to be stored and processed as part of a single application. If you enter a class group, leave the Keys array empty. In this case, the class group instance defines a common key structure used by all associated classes. |
The keys array appears only for concrete classes that either define a class group or that are do not belong to a class group.
If the Keys array appears, i9n many cases, you can leave it blank, at least when you first save the Class form:
Single Value
properties of
type Text
with this class as the
Applies To key part, enter the property
names into the Keys array before
you first save the Class form. When you save the form, the
system creates both the new class and properties.Date
, Time
,
DateTime
, or Double
as key parts
is permitted, but may introduce rounding or uniqueness
issues. Review the data representation on the external
database to confirm that it maps one-to-one with the
Process Commander representation.
Field |
Description |
Keys |
If two or more properties are to form the key, the order of rows in this array is significant. Consider which order is likely to produce a natural or frequently presented sort order in reporting or searching. For example, consider a class named Data-County, with a key formed from a county name (such as Suffolk, for Suffolk county) and state code (such as MA for Massachusetts). Assuming that reporting requirements present county information within state, a natural order for the two key parts is state followed by county. |
Name |
Optional. Leave blank if the concrete class is a subclass of a superclass that corresponds to a class group. Also, leave blank if a parent (or higher superclass) of this class is concrete and the key structure of this class is to be the same as the key structure of the parent. Identify the property or properties that together define a unique key for objects of this class. If the property or properties that are to form the key are not yet defined, you can create them automatically the first time you save the Class form by entering a name here. If the properties that are to make up the key are already defined (in a superclass), do not enter them initially. Save the Class form once, then use SmartPrompt to select them as rows in the Keys array, and then resave the Class form. Typically, the key of an object also determines how it is identified when locked. In the unusual case that a different key structure is needed, you can define a separate lock string on the Locking tab. |
Caption |
Optional. For concrete classes derived from Rule- or Data- for which a Form Builder form is present as a rule of type Rule-File-Form, this text appears as field labels in the New dialog box. In other cases, you can enter text to document why you chose this property to be part of the key; the information you enter appears only in this field. |
Completing the Rule Instances of this class fields
These four check boxes appear only for concrete classes derived from the Rule- base class, with a few exceptions. They determine which parts of the full rule resolution algorithm the system uses to find rules of the new rule type. See How the system finds rules through rule resolution and How to create a custom rule type.
Field |
Description |
Rule Instances of This Class | |
Allow multiple versions with the same key values? (rule resolution) |
When selected causes the system to allow multiple rules of this rule type to have the same name, distinguished by RuleSet or RuleSet version. If this box is selected, at runtime Process Commander uses the RuleSet list part of the rule resolution algorithm for this class to select a rule at runtime. |
Allow selection of rules based on property values? circumstance-qualified) |
When selected, causes the system to allow rules of this rule type to have circumstance-based qualifications. If this box is selected, at runtime Process Commander uses circumstance-based processing at runtime to select a rule, and these fields appear on the Save As form. See circumstance. This field appears only when the Allow multiple versions field is selected. |
Allow rules
that are valid only for a certain period of time? (date range availability) |
When selected, causes the system to allow rules of this rule type to have time-based qualifications. If this box is selected, Process Commander uses time-based processing at runtime to select a rule, and these fields appear on the Save As form. See time-based rules. This field appears only when the Allow multiple versions field is selected. |
Use
class-based-inheritance toarrive at
the correct rule to execute? |
When selected, causes the system to cause the system to search up the class inheritance structure (using both pattern and directed inheritance) to find rules of this rule type. If this box is not selected, at runtime Process Commander expects to find the rule in the current class only, not by searching through superclasses. |
Completing the Class Inheritance fields
Indicate how this class inherits rules from super classes.
Field |
Description |
Class Inheritance | |
Find by name first (Pattern)? |
Select to cause the system to use pattern inheritance before it uses directed inheritance when finding rules at runtime. Pattern inheritance searches superclasses based on prefixes of the class name that end in a dash character. Clear this box to bypass pattern inheritance. Directed inheritance always occurs for all rule types with an Applies To key part. If you selected After you save a Class form, you cannot change this setting. |
Parent class (Directed) |
Identify the class that is to be the immediate parent of this class:
After you save the Class form, you can use the Class Inheritance display to review the ancestor classes of this class and the order they are searched.
If you selected If you enter in this field the longest possible prefix of this class ending in a dash character, you can select or clear the Find by name first (Pattern)? box, with no difference in rule resolution behavior or results. For example, if this class is named Work-Object-Mortgage and the parent class is to be Work-Object-, Process Commander performs the same search regardless of the check box setting. Do not assume that the "inherits from" relationship is transitive. Because only one Parent class to inherit from (Directed) value is used by a rule resolution, it is possible that class C inherits from class B, and B inherits from A, but C does not inherit from A. You cannot create a class derived from the Code- or System- base classes. These base classes are reserved. |
Testing the class-to-database table mapping
For a concrete class, you can test the database connection and learn the table structure.
Test Connection to Database Table | |
Test Connection |
After you save the Class form, click to confirm that the database instance (Data-Admin-DB-Name) and database table instance (Data-Admin-DB-Table) are working as intended. The test confirms that Process Commander can access the database and displays the database table that will contain instances of this class. Results appear in a new window, identifying the database and database table that correspond to this concrete class, and whether the class is an internal or external class. This button appears only for concrete classes. |
How to include properties in a class as key parts of that class
As you complete the Key Name fields while adding a class, you can only reference existing property rules. If a key part for your new class is a property that will apply to the new class, you cannot create the property until after you create and save the class rule.
Take these steps to work around this circular situation: