So I’m really scratching my head on this one. My goal is to take a timestamp I have pulled from a prior message that shares the same value on a field, store that in a lookup table, pull said timestamp from the lookup table using the field value, and then calculate the interval between the two timestamps and assign that value to a field. But whenever I try to calculate the offset, I get the following Processing Error message:
an exception was thrown: java.lang.Long cannot be cast to java.lang.Double
Pipeline rule configured as such
rule "RTC-2:REST Alert-> Pop Time"
when
contains(to_string($message.message), "Pop Time", true)
then
let rct = lookup_value("rubycalltrack", ($message.RubyCallID));
set_field ("rcid_interval", (
parse_date(
value: to_string(
rct),
pattern: "yyyy-MM-dd'T'HH:mm:ss.SSSZ",
locale:"en_US")
.millis) -
parse_date(
value: to_string(
$message.timestamp),
pattern: "yyyy-MM-dd'T'HH:mm:ss.SSSZ",
locale:"en_US" )
.millis);
lookup_set_value ("rubycalltrack", to_string($message.RubyCallID), $message.timestamp);
end
And in just testing it now, I get the Processing Error
Error evaluating action for rule <RTC-2:REST Alert-> Pop Time/61f50de9876cfa3b78005fd9> (pipeline <Ruby Call Tracking Pipeline/61f51b43876cfa3b780070d4>) - In call to function 'set_field' at 6:4 an exception was thrown: java.lang.Long cannot be cast to java.lang.Double
I do know that the value is being properly pulled from the lookup table and is read with correct data type of date, as I previously had a line in the rule that set the older timestamp to a field and then used that field in the parse_date
function, and the field was set properly with type date
. But the math function always kicks the cast java error.
Any help is greatly appreciated.