LinkedIn
Copied!

Table of Contents

Change the type of property rule in a higher ruleset version

You can create a property rule that overrides an existing property rule (one with the same name and the same or subclass Applies To key part) that is in a lower version of the ruleset or in a ruleset and version that is lower on your ruleset list. However, Pega Platform restricts the Type values for the new property.

If you update or override a property rule of mode Single Value, Value List, or Value Group, you can change the property rule type to one that is more narrowly defined. This does not cause any run-time conversions of property values.

Allowed property type changes

The following table shows which property type changes are allowed. These changes are allowed because they do not result in data loss. For example, if a database expects a decimal for a given field and Pega Platform provides an integer, the data is safe. However, if a database expects a decimal and the system provides a Boolean, data is lost.

To type Date Time Date Time of day Integer Decimal Double True or false Text
From Type
Date Time
Date
Time of day
Integer
Decimal
Double
True or false
Text

For example, if the original property has a type of DateTime, you cannot override it with a new property that has a type of Double. If you try, an error message similar to the following is displayed:

"Definition required to conform to Cahaba-Work-CPM-Claims.Prop1 instance created 20050831T162223.149 GMT."

In this case, you can override the DateTime property in a higher ruleset version with a type of Date or TimeOfDay. Similarly, you can “specialize” a property of type Text.

It is a best practice to make such overrides when no work objects or other saved instances have a value for the property.

Overriding the property does not cause Pega Platform to convert any existing values of the property. Conversion can cause errors, as described in the following section.

You can use two methods to change the property type. To avoid validation issues and other processing errors, only override properties that are not yet saved in work objects.

Method 1: Delete and recreate the property using the new property type

If the field you want to change does not exist on production, you can delete the property rule in every system (such as application, testing, and production) and then recreate the property using the correct type.

For example, assume that you created a property named Prop1 with the type Integer in the 01-01-01 ruleset version, locked the version and continued development in 01-01-02. You now realize you need to change the type of Prop1 from Integer to Text. If you change the property and attempt to resave into 01-01-02 with the new type a general error occurs:

Definition required to conform to Cahaba-Work-CPM-Claims.Prop1 instance created 20050831T162223.149 GMT

In this case, you can delete Prop1 and recreate it using Text as its property type.

This method might not work in some cases. It is not recommended for fields that exist on production. For instance, assume you change a property called Prop2 (Value mode) from Text to Integer. Also assume that a work object contains alphabetic characters using Prop2 (as type Text). Because Prop2 type is now defined as an Integer, an error will likely occur during data dictionary validation, which occurs under the following circumstances:
  • User input on an HTML form is placed on the clipboard.
  • The Page-Validate method is applied to a page containing the property, or to the property if it has mode Page.
  • An Edit Input rule and Property-Validate method is applied to the property.

Method 2: Create a new property and block the old one

You can create a new property with a different name and use it going forward. Copy the old property with an availability setting of Blocked in a new ruleset version to prevent further use of it.

Use this method only in development systems; it is not advisable to make such changes in production environments.

Related Content

Article

Properties
Did you find this content helpful?

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.