Question

1
Replies
181
Views
Jeffrey Silver (Bellerophon)
Stratosphere Technical Consulting

Stratosphere Technical Consulting
US
Bellerophon Member since 2014 61 posts
Stratosphere Technical Consulting
Posted: January 9, 2017
Last activity: January 11, 2017
Posted: 9 Jan 2017 16:57 EST
Last activity: 11 Jan 2017 14:20 EST
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.

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, This thread is closed to future replies. Content and links will no longer be updated. If you have the same/similar Question, please write a new Question.