cancel
Showing results for 
Search instead for 
Did you mean: 

Date in activiti REST api

hemamalini
Champ in-the-making
Champ in-the-making
I have a form in my start event which has date fields. I am using Activiti REST component. In request body , how should i mention the date field . How activiti engine will identify it as date instead of string.
{
   "processDefinitionId":"dateTest:1:158",
   "businessKey":"myBusinessKey",
   "variables": [
      {
        "name":"start date",
        "value":"2015-11-26",
      }
   ]
}
How to specify the date format in request body?
2 REPLIES 2

balsarori
Champ on-the-rise
Champ on-the-rise
You can specify the variable type in JSON. For a date variable you would need to use the ISO-8601 format. The above request body would look something like this


{
  "processDefinitionId":"dateTest:1:158",
  "businessKey":"myBusinessKey",
  "variables": [{
     "name":"startDate",
     "type": "date",
     "value":"2015-11-26T00:00:00Z"
   }]
}

hemamalini
Champ in-the-making
Champ in-the-making
thanks a lot