Support Article
Date Issue with Simulation
Summary
Developer has reported inconsistency with Date Comparison between the results of Strategy execution when run by Simulation compared to other means. A developer has Contract with a Date Time Property that it must be compared with a Date.
This happens in a Decision Table, called by the Strategy. This works (does not fail and returns the correct results) when the Strategy is run through the Run button or NBAA, but when the Strategy is run through Simulation it fails.
In the example the date is compared with “20090121T200122.419 GMT”, but it also fails if compared with generated times such as @(Pega-RULES:DateTime).CurrentDateTime().Error Messages
Batch execution failed. Unable to execute strategy with componentName Strategy___Result___Final___Output. Reason : Strategy component Strategy___Result___Final___Output failed to execute: Strategy component SetCountOffers failed to execute: Strategy component FirstVertraege failed to execute: Strategy component VertraegeStrategy failed to execute: Strategy component Strategy___Result___Final___Output failed to execute: Strategy component StrategyExampleTwo failed to execute: PropertyValueInvalid .STODAT Cannot cast the value (20150129T230000.000 GMT) to BigDecimalSteps to Reproduce
1 Create a Strategy having Decision Table.
2 Compare the value through a DateTime Property.
3 Run the simulation object ID "SIM-19".
4 Error observed saying cannot cast the value to BigDecimal.Root Cause
The issue is with the date type conversion in DSMClipboardPage. And, it has been fixed on Pega 7.1.8.Resolution
Make use of the String library function "toDateTime" in the Decision Table, which converts a String to a BigDecimal and sets the Pega type as DataTime.
@(Pega-RULES:String).toDateTime(.DATE_OF_BIRTH)
Published June 2, 2016 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.