Localizing hardcoded error message from Final rule

Hello,

is there a way to create a localization for hardcoded error message that comes from a Final rule?

In my case it’s the “Check storage configuration.” error from pzUploadAndSaveFile rule:

Best regards!

Since the error message is coming from a Final rule, you won’t be able to override or modify the rule itself to add a message key. However, you can still localize it on the UI layer using Field Values.

Try creating a Field Value rule with the following configuration:

  • FieldName (Applies To): pyCaption

  • FieldValue: Check storage configuration. (Ensure this matches the hardcoded string exactly, including the period)

  • Localized Value: Your message

Pega’s UI rendering engine automatically looks up pyCaption field values for client-side strings and error messages displayed on screen and replaces with localized value.

@JakubA16839155

If we look the OOTB activity’s 10th step, the content of the Param.MessageOnUploadFailure is passed as an input parameter to a Message rule “pyUploadFailed”. Also, in step 19, you have one more hard coded message as well.

If you look at the message rule, we can define the type of the parameter of our choice. In this case, you can define the parameter to be “Message” as shown below

and then create message rules for “Check DB configuration.” and “Check storage configuration.” and when they are passed into the message rule, system will again check for the relevant message rules with the same name and render accordingly.

So modify the OOTB message rule “pyUploadFailed” in your Application ruleset and change the parameter type to Message and then create the two new message rules with your specific text.

I have tested this configuration in a simple DT step like below and it works.

Setup

Output

Try it and let us know if it works for you as well. I have tested this in 25.1.2.

Honestly, i didn’t knew that this is possible. So, it’s a learning for me as well :slight_smile:

Regards

JC

Hi @JayachandraSiddipeta , thank you for your answer!

The issue is not with the first part of error message - pyUploadFailed (which itself is Available for modification, and is translated using Message rule as you mentioned), but the second part of error message - the hardcoded part that comes after pyUploadFailed - “Check storage configuration.”, which is hardcoded into a rule that is Final.

Best regards!

Hi @VVNagaSaiN , thank you for your answer.

Unfortunately creating Field Value for pyCaption with translation for the “Check storage configuration.” didn’t work, maybe because the error contains two parts - the pyUploadFailed (which can be translated) and the second part, which is hardcoded and can’t be translated as such - “Check storage configuration.”?

I tried to create a Field Value for the whole error message containing both parts, but it’s too long (it exceeds characters limit for Field Value).

Best regards!

You have to create new message rules with the below names

  1. “Check DB configuration.”
  2. “Check storage configuration.”

And put whatever content you want to put in it.

Also modify the OOTB message rule “pyUploadFailed” in your Application ruleset and change the parameter type to “Message” as shown above.

Pega will render the content from your message rules accordingly.

You don’t need to update anything in the OOTB final activity.

Hope this is clear

Regards

JC