After upgrading our REST application from Activiti 5.18.0 to 7.9.0 with activiti-spring-boot-starter, almost everything worked as expected.
However, after upgrading, any of our own REST endpoints with a Date query parameter no longer respect our own
where we use something like this Format Utility (FU) class
public class FU { public static final String OPTIMUS_DATE = "yyyy-MM-dd"; public static final String OPTIMUS_DATE_TIME = "yyyy-MM-dd'T'HH:mm:ssZ";
...
(other stuff ommitted)
}
and decorate the attributes in our REST endpoints like this one
@RequestMapping(value = "/workflowmanagement/process-variable-exceptions-detail", method = RequestMethod.GET) public TotalResult<List<ProcessVariableByTextSince>> getProcessVariables( @RequestParam(value = "datefrom", required = false) @DateTimeFormat(pattern = FU.OPTIMUS_DATE_TIME) Date dateFrom, @RequestParam(value = "dateto", required = false) @DateTimeFormat(pattern = FU.OPTIMUS_DATE_TIME) Date dateTo, @RequestParam(value = "variablename", required = true) String variableName, @RequestParam(value = "variabletext", required = false) String variableText,
we get this type of error
{ "readyState": 4, "responseText": "{\"message\":\"Failed to convert value of type 'java.lang.String' to required type 'java.util.Date'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [@org.springframework.web.bind.annotation.RequestParam @org.springframework.format.annotation.DateTimeFormat java.util.Date] for value '2023-10-12'; nested exception is java.time.format.DateTimeParseException: Text '2023-10-12' could not be parsed at index 10\"}", "responseJSON": { "message": "Failed to convert value of type 'java.lang.String' to required type 'java.util.Date'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [@org.springframework.web.bind.annotation.RequestParam @org.springframework.format.annotation.DateTimeFormat java.util.Date] for value '2023-10-12'; nested exception is java.time.format.DateTimeParseException: Text '2023-10-12' could not be parsed at index 10" }, "status": 500, "statusText": "error" }
This seems to be related to either
But happy to get any pointers on where this is coming from or how to configure, override, or extend it.
How can we include Activiti Process Engine 7.9.0 in our application to use the Java API and restrict this custom Date handling to work for the Activiti models only and not effect ours?
Or override or extend this behavior to accomodate those endpoint parameters that we want to use simple date strings without the full ISO 8601 date time zone format string?
And am I correct in understanding that with activiti-spring-boot-starter, it doesn't include any REST controller or define any REST endpoints for the Java APIs, but enforces the ISO 8601 date format for all the API models Date attributes for Jackson serialization?
Ask for and offer help to other Alfresco Process Services and Activiti Users and members of the Alfresco team.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.