Question

1
Replies
163
Views
Bellerophon Member since 2014 61 posts
Stratosphere Technical Consulting
Posted: 3 years ago
Last activity: 3 years 8 months ago
Closed
Solved

ClassCastException in CustomGuardrailWarning exercise

Hii.  I am getting the following error at runtime when my java step is executed, as soon as I add a 13th step to an activity to test the exercise.   I created my rules in Rule-Obj-Activity and then created a test activity with 12 property sets.   When I add the 13th property set so that the custom guardrail warning should be triggered, and click save, I get the error.

This record has
2
Errors
in
2
places
Save failed:
Java Exception: java.lang.ClassCastException

This is the java which was taken from solution walkthrough modfied slightly for my difference in message rule name

// get add to property 
ClipboardProperty addToProperty = myStepPage.getProperty(".pyAutoHtml");
// set message parameters 
HashStringMap parameters = new HashStringMap(); 
parameters.put("NumberOfSteps", NumberOfSteps);
// add guardrail warning to activity 
pega_wb_default.pxAddGuardrailMessage(addToProperty, "NumofStepsGuardrailWarn", parameters);

Pega Academy
Moderation Team has archived post
Share this page LinkedIn