✅ SolvedRules & Flows

How to implement custom validation rules in PEGA?

Sarah ChenDeveloper
2 days ago
245 views
#validation#rules#case-type

I'm trying to create a custom validation rule for email format validation in my case type. I've looked at the documentation but I'm still confused about the best approach.

Here's what I want to achieve:

  • Validate email format on a property
  • Show custom error message if invalid
  • Apply this validation across multiple case types

I've tried using the built-in email format validation, but I need more specific validation rules for our business requirements.

Any guidance would be greatly appreciated!

2 Replies

Accepted Answer

Mike Rodriguez

Senior Architect1 day ago

Great question! For custom email validation in PEGA, you have a few options:

Option 1: Edit Validate Rule

Create an Edit Validate rule with a custom Java function or regex pattern:

@IsValidEmail(.EmailProperty)

Option 2: Custom Function

You can create a custom function in a library rule and call it from your validation.

I'd recommend Option 1 for most cases as it's more maintainable.

Jennifer Liu

Lead Developer18 hours ago

Building on Mike's answer, here's a complete example:

  1. Create Edit Validate rule: ValidateEmail
  2. Set the condition to check email format
  3. Add custom error message
  4. Reference this rule in your case type properties

This approach ensures consistency across all your case types.

Add Your Reply