Property-Validate method
Use the Property-Validate method in an activity to ensure that a property value meets certain requirements including:
- Checking performed by an edit validate rule ( Rule-Edit-Validate rule type)
- A requirement that a property have a non-null value
You can also provide default values for properties.
If your planned activity can consist entirely of Property-Validate methods, you don't need to create an activity. Create a validate rule ( Rule-Obj-Validate ) instead.
Parameters
This method has an array of parameters, seven per row.
Parameter | Description |
---|---|
PropertyName | Enter a property reference, identifying the property to be validated. |
ValidateAs | Optional. Identify a literal key to an edit validate rule, or enter an expression that returns true or false when applied to the property. If left blank, the edit validate rule referenced in the property itself (if any) is used. |
Continue |
Select the box to cause the processing of this method to continue after a validation error. Clear the box to cause this method to stop after one validation error is found. |
Default | Optional. Provide a value to set if the property identified in the PropertyName column of this row has no value. |
Required |
Select the box to require that the property has a non-blank value. If selected and the property value is blank, the system associates the message
with the property. You cannot override this message text. The value in the ErrorMessage parameter does not override this message. |
ErrorMessage |
Optional. Enter a text string for the message created if the rule defined in the
ValidateAs
parameter fails. If you leave this blank, the system uses a generic message.
This text is not used when the Required box is selected. |
OnlyIfChanged | Leave cleared. Not used. |
Results
The system validates the properties identified in the first column one by one, starting with the first row. It stops when all rows are evaluated, or when a property fails validation and the Continue check box for that row is not selected.
A property fails validation if the edit validate rule returns false, or if the Required parameter is selected but the property is missing or has a blank (null) value. When a property fails validation, the system adds a message to the clipboard page. Ordinarily, pages that contain messages (indicating errors) are not saved into the PegaRULES database.
Checking the method status
This method updates the pxMethodStatus property. See How to test method results using a transition.