Issue with Input parameter of Rule-Utility-Function
We would like to convert EpochTime(in milliseconds) to the internal Pega DateTime format , the Rule-utility-Function is created to take the input of EpochTime which contains 13 digits ( for example:-1708502026295 ) ..
if the function input data type is Long then it works fine but we can't invoke the function from any rule unless invoke it from java step, because system is not able to find out the function with data type as Long as pega don't have data type for long ..
If the function input data type is bigdecimal then it throwing an error (Java Exception: java.lang.ClassCastException: com.pega.ibm.icu.math.BigDecimal cannot be cast to java.math.BigDecimal ) we are not sure what it's is about .
If input type is defined as double then passing the 13 digit value as input to the function then it's being converted to 1.708467440242E12 and giving the below error in logs about function library issue.
We would like to convert EpochTime(in milliseconds) to the internal Pega DateTime format , the Rule-utility-Function is created to take the input of EpochTime which contains 13 digits ( for example:-1708502026295 ) ..
if the function input data type is Long then it works fine but we can't invoke the function from any rule unless invoke it from java step, because system is not able to find out the function with data type as Long as pega don't have data type for long ..
If the function input data type is bigdecimal then it throwing an error (Java Exception: java.lang.ClassCastException: com.pega.ibm.icu.math.BigDecimal cannot be cast to java.math.BigDecimal ) we are not sure what it's is about .
If input type is defined as double then passing the 13 digit value as input to the function then it's being converted to 1.708467440242E12 and giving the below error in logs about function library issue.
2024-02-20 23:17:03,442 [7.100.156-443-exec-5] [TABTHREAD3] [ ] [ MyAPP:04.01.01] (l.library.LibraryMetadataCache) ERROR MyAPP-api.u5.myorgnet.org|XX.XX.XX.XX Admin_DEV - Incompatible pega type -integer for java type - (Java double, PropertyInfoType: , PegaType: double), in function definition-ConvertEpochToDateTime 2024-02-20 23:17:03,444 [7.100.156-443-exec-5] [TABTHREAD3] [ ] [ MyAPP:04.01.01] (l.library.LibraryMetadataCache) ERROR MyAPP-api.u5.myorgnet.org|XX.XX.XX.XX Admin_DEV - Incompatible pega type -integer for java type - (Java double, PropertyInfoType: , PegaType: double), in function definition-ConvertEpochToDateTime 2024-02-20 23:17:26,695 [7.100.156-443-exec-4] [ STANDARD] [ ] [ MyAPP:04.01.01] (l.library.LibraryMetadataCache) ERROR MyAPP-api.u5.myorgnet.org|XX.XX.XX.XX Admin_DEV - Incompatible pega type -integer for java type - (Java double, PropertyInfoType: , PegaType: double), in function definition-ConvertEpochToDateTime 2024-02-20 23:17:26,773 [7.100.156-443-exec-4] [ STANDARD] [ ] [ MyAPP:04.01.01] (s.generated.skan_skanutilities) INFO MyAPP-api.u5.myorgnet.org|XX.XX.XX.XX Admin_DEV - 1.708467440242E12 2024-02-20 23:17:26,775 [7.100.156-443-exec-4] [ STANDARD] [ ] [ MyAPP:04.01.01] ( internal.mgmt.Executable) ERROR MyAPP-api.u5.myorgnet.org|XX.XX.XX.XX Admin_DEV - Exception: 2024-02-20 23:17:26,776 [7.100.156-443-exec-4] [ STANDARD] [ ] [ MyAPP:04.01.01] ( internal.mgmt.Executable) ERROR MyAPP-api.u5.myorgnet.org|XX.XX.XX.XX Admin_DEV - Exception: 2024-02-20 23:17:26,777 [7.100.156-443-exec-4] [ STANDARD] [ ] [ MyAPP:04.01.01] ( internal.mgmt.Executable) ERROR MyAPP-api.u5.myorgnet.org|XX.XX.XX.XX Admin_DEV - Exception: 2024-02-20 23:17:26,778 [7.100.156-443-exec-4] [ STANDARD] [ ] [ MyAPP:04.01.01] (ngineinterface.service.HttpAPI) ERROR MyAPP-api.u5.myorgnet.org|XX.XX.XX.XX Admin_DEV - XX.XX.XX.XX: com.pega.pegarules.pub.PRRuntimeError 2024-02-20 23:17:46,915 [7.100.156-443-exec-8] [TABTHREAD3] [ ] [ MyAPP:04.01.01] (l.library.LibraryMetadataCache) ERROR MyAPP-api.u5.myorgnet.org|XX.XX.XX.XX Admin_DEV - Incompatible pega type -integer for java type - (Java double, PropertyInfoType: , PegaType: double), in function definition-ConvertEpochToDateTime 2024-02-20 23:17:46,917 [7.100.156-443-exec-8] [TABTHREAD3] [ ] [ MyAPP:04.01.01] (l.library.LibraryMetadataCache) ERROR MyAPP-api.u5.myorgnet.org|XX.XX.XX.XX Admin_DEV - Incompatible pega type -integer for java type - (Java double, PropertyInfoType: , PegaType: double), in function definition-ConvertEpochToDateTime
For now the work around is , the input data type is defined as string and convert it to long type in function to use the time methods .
***Edited by Moderator Rupashree to add Capability tags***