Creating classes
For improved development and maintenance of your application, organize the rules and other objects in your application into classes. By creating classes, you define collections of objects that are available to other classes or to instances of the class. You can reuse classes, and as a result reduce both development time and costs.
- In the header of Dev Studio, click .
- In the Class record configuration section, in the Label field, enter a short description for the class that you want to create.
- In the Class name field, enter a unique name for your
class.To show the relationship between classes, use a hyphen in the class name in which the first name is a parent class.
- In the Context section, select an application layer in which to store your class.
- In the Add to ruleset list, select a ruleset in which to store your class.
- Optional: To override the default work item that your application associates with this class, in
the Work item to associate field, press the Down arrow key, and
then select a work item.For more information about default work items, see Setting your current work item.
- Click Create and open.
- On the General tab of the class form, select a class type, and
then define the class settings for your new class:
Choices Actions Define the settings for an abstract class - In the Select class type list, select Abstract.
- In the Settings section, in the Created in
version field, enter the ruleset version that applies to this
class, and then go to step 10.Abstract classes have no instances in a database.
Define the settings for a concrete class - In the Select class type list, select Concrete.
- In the Settings section, in the Created in
version field, enter the ruleset version that applies to this
class, and then go to step 9.Concrete classes have instances in a database. For more information, see Class keys.
- Define the class group settings of a concrete class:
Choices Actions Create a class group - In the This class list, select The class is a class group.
- Optional: 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, select the Encrypt
BLOB check box.For more information, see Encrypting the storage stream (BLOB).
- Optional: To define key parts of the class, in the Keys section,
provide a key name and a caption.For more information about class keys, see Class keys.
- Optional: If you provide only one key, to ensure that instances of this class are unique, and to automatically supply a globally unique value for further new instances, select the Automatically generate a unique ID for records of this type check box.
Define the settings for a class that does not belong to a class group - In the This class list, select does not belong to a class group.
- Optional: 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, select the Encrypt
BLOB check box.For more information, see Encrypting the storage stream (BLOB).
- Optional: To define the key parts of the class, in the Keys
section, provide a key name and a caption.For more information about class keys, see Creating classes.
Define the settings for a class that belongs to a class group - In the This class list, select belongs to a class group.
- In the Class group field, enter a class group name that you want to include this class.
- Optional: 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, select the Encrypt
BLOB check box.For more information, see Encrypting the storage stream (BLOB).
- In the Class inheritance section, define how the class that you
create inherits rules from superclasses:
- Optional: To use pattern inheritance before direct inheritance when the system finds rules at
run time, select the Find by name first (Pattern) check
box.Pattern inheritance searches in superclasses based on prefixes to class names that end in a hyphen.
- In the Parent Class (Directed) field, enter the class name
of the immediate parent of your new class:
For concrete classes that are class groups, enter Work- or a class that inherits from the Work- base class, or enter History-Work- or a class that inherits from the History-Work- class, if you create a class to hold the history of work items.
If you enter the longest possible prefix for your new class ending in a hyphen, you can select or clear the Find by name first (Pattern) check box, with no difference in rule resolution behavior or results. For example, if you create a Work-Object-Mortgage class and the parent class is Work-Object-, the system performs the same search regardless of the check box setting. Avoid using System- and Code- base classes, because these classes are reserved.
- Optional: To use pattern inheritance before direct inheritance when the system finds rules at
run time, select the Find by name first (Pattern) check
box.
- Click Save.
- Optional: If you create a concrete class, check the class connection with the database by
clicking Test connection.
- Naming conventions for classes
Unified naming standards for classes help you manage your resources in a logical and efficient way. You can avoid duplicating your content, maximize efficiency, and speed up application development by sharing resources between multiple classes or class layers.
- Class keys
When you define concrete classes, you can add keys to identify classes. You can add the keys when you create a class, or you can update the keys later.
Previous topic External classes Next topic Naming conventions for classes