AnsweredAssumed Answered

Complete a task with enum variable

Question asked by ilansch on Jan 18, 2016
Latest reply on Jan 18, 2016 by actarus16
Hi, I use rest api to complete a task. one of the task variable is enum type.

When i send the json of complete task i send this: 
"{\"action\":\"complete\",\"variables\":[{\"name\":\"sport\",\"value\":\"swim\",\"type\":\"enum\"}]}"

this is not good, activiti throws exception:
Bad request (400) - Variable 'sport' has unsupported type enum.

When i send it as type=string (instead of type=enum, its ok, but then the type saved will be string - i check the variables of the task after its completed (via REST API get task variables)

How should i send the json ?

What is wierd ? When i run a get form parameters ("form/form-data?taskId=XXXX") i get the following
"{\"formKey\":null,\"deploymentId\":\"7601\",\"processDefinitionId\":null,\"processDefinitionUrl\":null,\"taskId\":\"7618\",\"taskUrl\":\"http://localhost:1248/activiti-rest/service/runtime/tasks/7618\',\'formProperties\":[{\"id\":\"sport\",\"name\":\"sport\",\"type\":\"enum\",\"value\":null,\"readable\":true,\"writable\":true,\"required\":true,\"datePattern\":null,\"enumValues\":[{\"id\":\"swim\",\"name\":\"swim\"},{\"id\":\"run\",\"name\":\"run\"},{\"id\":\"walk\",\"name\":\"walk\"}]}]}"

Outcomes