Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

AggregateIHData strategy error (dateTimeToBigDecimal)

SA-72757

Summary



Post upgrade to Pega 8.1.1 and Strategic Application 8.1.1, error occurs when running a Strategy rule.
The strategy uses a Set property strategy component.


@if(CountResponses.CountOffers = 0, 0, @(Pega-RULES:DateTime).dateTimeToBigDecimal(.pxOutcomeTime, "DateTime", tools))

However, the same Strategy works correctly in the Pega 7.2.2.




Error Messages



Strategy [ABC] failed to execute. Details: Component Set AA Properties in strategy ABC cannot be optimized. Semantic Problems with tree:
Type Mismatch in node 'ILTernaryOperation': False branch does not equal return type (DATETIME ==> DECIMAL)

Caused by: com.pega.platform.codegeneration.il.SemanticAnalysisException: Semantic Problems with tree:
Type Mismatch in node 'ILTernaryOperation': False branch does not equal return type (DECIMAL ==> DATETIME)

    at com.pega.platform.codegeneration.il.validator.ILTreeValidator.analyze(ILTreeValidator.java:66) ~[codegeneration.jar:?]
    at com.pega.pegarules.generation.internal.assembly.il.ILTransformer.processNode(ILTransformer.java:235) ~[prprivate.jar:?]
    at com.pega.pegarules.generation.internal.assembly.antlr4.Antlr4Semantics.applySemantics(Antlr4Semantics.java:110) ~[prprivate.jar:?]
    at com.pega.pegarules.generation.internal.assembly.antlr3.RuleAssemblyContext.applySemantics(RuleAssemblyContext.java:1051) ~[prprivate.jar:?]
    at com.pega.pegarules.generation.internal.assembly.parser.antlr4.Antlr4Interface.doSemanticAnalysis(Antlr4Interface.java:89) ~[prexprantlr4.jar:?]
    at com.pega.pegarules.generation.internal.assembly.antlr3.Antlr3TranslateExpression.parseExpression(Antlr3TranslateExpression.java:669) ~[prprivate.jar:?]
    at com.pega.pegarules.generation.internal.assembly.antlr3.Antlr3TranslateExpression.translateExpressionIL(Antlr3TranslateExpression.java:767) ~[prprivate.jar:?]
    at com.pega.pegarules.generation.internal.assembly.translator.TranslatorHarness.translateExpressionToILDispatch(TranslatorHarness.java:164) ~[prprivate.jar:?]
    at com.pega.pegarules.generation.internal.assembly.translator.FUAJavaGenerateHelper.translateExpressionToIL(FUAJavaGenerateHelper.java:369) ~[prprivate.jar:?]
    at com.pega.pegarules.generation.internal.assembly.translator.FUAJavaGenerateHelper.translateExpressionToIL(FUAJavaGenerateHelper.java:361) ~[prprivate.jar:?]
    at com.pega.pegarules.generation.internal.assembly.FUAHelperImpl.translateExpressionToIL(FUAHelperImpl.java:2148) ~[prprivate.jar:?]
    at com.pega.decision.strategy.parser.ExprParserUtil.parseExpressionILInner(ExprParserUtil.java:153) ~[strategy-8.1.0-192.jar:?]
    at com.pega.decision.strategy.parser.ExprParserUtil.getILStructure(ExprParserUtil.java:141) ~[strategy-8.1.0-192.jar:?]
    at com.pega.decision.strategy.parser.StrategyParser.parseExprWithIL(StrategyParser.java:1408) ~[strategy-8.1.0-192.jar:?]
    at com.pega.decision.strategy.parser.StrategyParser.parseStrategyExpression(StrategyParser.java:1390) ~[strategy-8.1.0-192.jar:?]
    at com.pega.decision.strategy.parser.StrategyParser.processSetProperty(StrategyParser.java:564) ~[strategy-8.1.0-192.jar:?]
    at com.pega.decision.strategy.parser.StrategyParser.processComponentInner(StrategyParser.java:470) ~[strategy-8.1.0-192.jar:?]
    at com.pega.decision.strategy.parser.StrategyParser.processDrivers(StrategyParser.java:527) ~[strategy-8.1.0-192.jar:?]
    at com.pega.decision.strategy.parser.StrategyParser.processComponentInner(StrategyParser.java:424) ~[strategy-8.1.0-192.jar:?]
    at com.pega.decision.strategy.parser.StrategyParser.parse(StrategyParser.java:296) ~[strategy-8.1.0-192.jar:?]
    at com.pega.decision.strategy.parser.StrategyParser.parseTerminalComponents(StrategyParser.java:243) ~[strategy-8.1.0-192.jar:?]
    at com.pega.decision.strategy.parser.StrategyParser.parseStrategy(StrategyParser.java:219) ~[strategy-8.1.0-192.jar:?]
    at com.pega.decision.strategy.parser.StrategyParser.buildSSAProgram(StrategyParser.java:213) ~[strategy-8.1.0-192.jar:?]
    at com.pegarules.generated.strategy.sh_action_teststrategy_c794a83bd3ddccdaa771ca359ffdf223.pzbuildSsaProgram(sh_action_teststrategy_c794a83bd3ddccdaa771ca359ffdf223.java:180) ~[?:?]



Steps to Reproduce

  1. Upgrade Pega 7.2.2 to Pega 8.1.1.
  2. Create a Strategy with an Interaction History (IH) Import shape and a Property Set shape in the PegaMKT-Data-Customer class.
  3. Use the following expression and test run the strategy.

    @if(true, @(Pega-RULES:DateTime).dateTimeToBigDecimal(.pxOutcomeTime,"DateTime",tools), 0) 

Root Cause



A defect in Pegasystems’ code or rules.
The DateTimeToBigDecimal output section had both Java Type and Pega Type defined. However, they were different.
The issue occurred due to the generation of code from the below expression,


@if(true, @(Pega-RULES:DateTime).dateTimeToBigDecimal(.pxOutcomeTime,"DateTime",tools), 0)


Resolution



As a local-change, remove the @if call and use a general ternary expression.

For example:

Property Set:
Target: myIntProp
Source: CountResponses.CountOffers = 0 ? 0 : @(Pega-RULES:DateTime).dateTimeToBigDecimal(.pxOutcomeTime, "DateTime", tools)

Modify the Source to (CountResponses.CountOffers = 0) ? 0 : @(Pega-RULES:DateTime).dateTimeToBigDecimal(.pxOutcomeTime, "DateTime", tools)

 

Published March 21, 2019 - Updated December 2, 2021

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us