Problem: Dates in different format for create process and get Task Info
![bobfleischman bobfleischman](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-03-2014 04:29 PM
We are developing around the rest service and have noticed the following problem.
When we create a process we need to send the date using
private ISO8601DateFormat ISO8601DATEFORMAT = new ISO8601DateFormat();
However, when we request information on a task the date is returned as 2014-04-03T00:55:00.643+0000 and will not parse with the ISO8601DATEFORMAT.
We have worked around this for now, but it would be nice to use the same format for input and output.
Thank you,
Bob
When we create a process we need to send the date using
private ISO8601DateFormat ISO8601DATEFORMAT = new ISO8601DateFormat();
However, when we request information on a task the date is returned as 2014-04-03T00:55:00.643+0000 and will not parse with the ISO8601DATEFORMAT.
We have worked around this for now, but it would be nice to use the same format for input and output.
Thank you,
Bob
Labels:
- Labels:
-
Archive
5 REPLIES 5
![trademak trademak](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2014 03:54 AM
You are using the REST API right?
Which REST services are you using and experiencing this issue with?
Best regards,
Which REST services are you using and experiencing this issue with?
Best regards,
![bobfleischman bobfleischman](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-07-2014 11:44 AM
Yes, we are using the REST API for all interactions with the Activiti Engine.
We are using activiti-rest 5.15.1 - the latest stable release
Thanks,
Bob
We are using activiti-rest 5.15.1 - the latest stable release
Thanks,
Bob
![trademak trademak](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2014 09:25 AM
Hi Bob,
Okay thanks, but which specific REST services are using and experiencing these issues with?
Best regards,
Okay thanks, but which specific REST services are using and experiencing these issues with?
Best regards,
![bobfleischman bobfleischman](https://connect.hyland.com/legacyfs/online/avatars/Blue-user-logo.png)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2014 11:21 AM
Here are my constants
The issue seems to be specifically related to global variables.
Thanks
Bob
HashMap<String,Object> response2 = restTemplate.postForObject( activiti_rest_base_url + RUNTIME_PROCESS , request, HashMap.class);
String url = activiti_rest_base_url + TASK_URL + "?taskId=" + pTaskId + "&includeTaskLocalVariables=true&includeProcessVariables=true";
private BPMServer activiti_server = BPMServer.TEST;
private String activiti_rest_base_url = "http://" + activiti_server.getServerName() + "/activiti-rest/service";
private static final String TASK_URL = "/history/historic-task-instances";
private static final String RUNTIME_PROCESS = "/runtime/process-instances";
[\code]
To Create a process I use this
[code] HashMap<String,Object> response2 = restTemplate.postForObject( activiti_rest_base_url + RUNTIME_PROCESS , request, HashMap.class);
To get the task info I use this:String url = activiti_rest_base_url + TASK_URL + "?taskId=" + pTaskId + "&includeTaskLocalVariables=true&includeProcessVariables=true";
The issue seems to be specifically related to global variables.
Thanks
Bob
HashMap<String,Object> response2 = restTemplate.postForObject( activiti_rest_base_url + RUNTIME_PROCESS , request, HashMap.class);
String url = activiti_rest_base_url + TASK_URL + "?taskId=" + pTaskId + "&includeTaskLocalVariables=true&includeProcessVariables=true";
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-22-2014 06:15 AM
We use the jackson ISO8601 way of reading/writing dates, we force all dates to be written in ISO8601:
The input accepts a variety of formats (including ISO8601), when date-typed members are encountered. Perhaps the ISO8601DATEFORMAT you're using is more strict or does not cover all possible notations?
// Get hold of JSONConverter and enable ISO-date format by default
List<ConverterHelper> registeredConverters = Engine.getInstance().getRegisteredConverters();
for(ConverterHelper helper : registeredConverters) {
if(helper instanceof JacksonConverter) {
JacksonConverter jacksonConverter = (JacksonConverter) helper;
jacksonConverter.getObjectMapper().configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, false);
}
}
The input accepts a variety of formats (including ISO8601), when date-typed members are encountered. Perhaps the ISO8601DATEFORMAT you're using is more strict or does not cover all possible notations?
![](/skins/images/3EA4296CAFBBFFCF1FE252BDE05FE3BC/responsive_peak/images/icon_anonymous_message.png)