apache / incubator-kie-kogito-runtimes

Kogito Runtimes - Kogito is a cloud-native business automation technology for building cloud-ready business applications.
http://kogito.kie.org
Apache License 2.0
541 stars 209 forks source link

Dates are visualized as numbers in the UI #3778

Open fjtirado opened 3 hours ago

fjtirado commented 3 hours ago

Description

In general, for display representation purposes and also for jq filtering, Dates should be handled as string. For example, if an openapi server returns a date, the representation of the workflow model that is written into the UI is

{
  "id": "1",
  "dateTime": 1731585490.4387977,
  "correlation": "w1",
  "description": "call"
}

Implementation ideas

Add disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) to ObjectMapper.

tiagobento commented 3 hours ago

Shouldn't this be handled in the UI instead? Or maybe have both formats in the API?

fjtirado commented 2 hours ago

there is not type information in json and the variables are arbitrary data, so it will be difficult to distinguish between a real number and a number that represent a date. By sendings a string in iso format, UI, if needed, might use a pattern to replace them by the chosen representation format. By default, an ISO date string will be writen. Also, this json might be manipulated before being sent to the UI through jq filters and date manipulation (strange case, but posible) it is "easier" if it is a string