haihn
January 26, 2022, 10:57am
1
I’m using engine-rest to evaluate rule, but when input date data error will apear
{
"type": "InvalidRequestException",
"message": "Cannot convert value '1997-12-10T00:00:00' of type 'Date' to java type java.util.Date"
}
My curl and dmn file bellow, thank you
curl --location --request POST 'http://localhost:8080/engine-rest/decision-definition/key/birthOfDate/evaluate' \
--header 'Content-Type: application/json' \
--data-raw '{
"variables": {
"dateOfBirth": {
"value": "1997-12-10T00:00:00",
"type": "Date"
}
}
}'
birth-of-date.dmn (1.4 KB)
Hi @haihn
If I correctly understand the problem then I guess you might need to add TZ and milliseconds to the date. Like “1997-12-10T00:00:00.000+02:00”.
Please check the documentation - Date Format | docs.camunda.org
haihn
January 26, 2022, 11:03am
3
Hi @Alex_Voloshyn added TZ error still apear
{
"type": "InvalidRequestException",
"message": "Cannot convert value '1997-12-10T00:00:00.000+02:00' of type 'Date' to java type java.util.Date"
}
What if you try to change the TZ to +0200
(without colons)?
1 Like
haihn
January 26, 2022, 11:09am
5
Oh it works, thank you very much
You’re welcome. Please mark the reply as the solution so it’s visible that the issue was solved.
1 Like