cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti 7 Spring Boot Starter - Activiti API Models Date formatting impacting our own models

Kevin-Harrison
Champ in-the-making
Champ in-the-making

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

  • CommonModelAutoConfiguration
  • ProcessModelAutoConfiguration

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?

0 REPLIES 0
Getting started

Explore our Alfresco products with the links below. Use labels to filter content by product module.