POST /runtime/tasks/{taskId}

I used Flowable Task to create a process instance.

GET runtime/tasks

curl -H "Content-Type: application/json" \
     -X GET http://flowable-rest:test@localhost:8080/flowable-task/process-api/runtime/tasks

Output:

{
    "data": [
        {
            "id": "36803780-32a0-11ea-85ef-0242ac110004",
            "url": "http://localhost:8080/flowable-task/process-api/runtime/tasks/36803780-32a0-11ea-85ef-0242ac110004",
            "owner": null,
            "assignee": "rob.ferguson",
            "delegationState": null,
            "name": "My First Task",
            "description": "My first Flowable task",
            "createTime": "2020-01-09T05:23:47.875Z",
            "dueDate": null,
            "priority": 50,
            "suspended": false,
            "claimTime": null,
            "taskDefinitionKey": null,
            "scopeDefinitionId": null,
            "scopeId": null,
            "scopeType": null,
            "tenantId": "",
            "category": null,
            "formKey": null,
            "parentTaskId": null,
            "parentTaskUrl": null,
            "executionId": null,
            "executionUrl": null,
            "processInstanceId": null,
            "processInstanceUrl": null,
            "processDefinitionId": null,
            "processDefinitionUrl": null,
            "variables": []
        },
        {
            "id": "40ac7f4b-32b4-11ea-85ef-0242ac110004",
            "url": "http://localhost:8080/flowable-task/process-api/runtime/tasks/40ac7f4b-32b4-11ea-85ef-0242ac110004",
            "owner": null,
            "assignee": "rob.ferguson",
            "delegationState": null,
            "name": "Fill in a Leave Application Form",
            "description": null,
            "createTime": "2020-01-09T07:47:14.877Z",
            "dueDate": null,
            "priority": 50,
            "suspended": false,
            "claimTime": null,
            "taskDefinitionKey": "sid-3BA1F4D1-500F-4766-89BF-519166929F2D",
            "scopeDefinitionId": null,
            "scopeId": null,
            "scopeType": null,
            "tenantId": "",
            "category": null,
            "formKey": "leave-application-form",
            "parentTaskId": null,
            "parentTaskUrl": null,
            "executionId": "40ac5837-32b4-11ea-85ef-0242ac110004",
            "executionUrl": "http://localhost:8080/flowable-task/process-api/runtime/executions/40ac5837-32b4-11ea-85ef-0242ac110004",
            "processInstanceId": "40ac5834-32b4-11ea-85ef-0242ac110004",
            "processInstanceUrl": "http://localhost:8080/flowable-task/process-api/runtime/process-instances/40ac5834-32b4-11ea-85ef-0242ac110004",
            "processDefinitionId": "leave-application-process:1:c0573581-3298-11ea-85ef-0242ac110004",
            "processDefinitionUrl": "http://localhost:8080/flowable-task/process-api/repository/process-definitions/leave-application-process:1:c0573581-3298-11ea-85ef-0242ac110004",
            "variables": []
        }
    ],
    "total": 2,
    "start": 0,
    "sort": "id",
    "order": "asc",
    "size": 2
}

GET runtime/tasks/{formId}/form

curl -H "Content-Type: application/json" \
     -X GET http://flowable-rest:test@localhost:8080/flowable-task/process-api/runtime/tasks/40ac7f4b-32b4-11ea-85ef-0242ac110004/form

Output:

{
    "id": "c064ca14-3298-11ea-85ef-0242ac110004",
    "name": "Leave Application Form",
    "description": null,
    "key": "leave-application-form",
    "version": 1,
    "fields": [
        {
            "fieldType": "FormField",
            "id": "givenName",
            "name": "Given Name",
            "type": "text",
            "value": null,
            "required": true,
            "readOnly": false,
            "overrideId": true,
            "placeholder": "",
            "layout": null
        },
        {
            "fieldType": "FormField",
            "id": "familyName",
            "name": "Family Name",
            "type": "text",
            "value": null,
            "required": true,
            "readOnly": false,
            "overrideId": true,
            "placeholder": null,
            "layout": null
        },
        {
            "fieldType": "FormField",
            "id": "employeeNumber",
            "name": "Employee Number",
            "type": "integer",
            "value": null,
            "required": true,
            "readOnly": false,
            "overrideId": true,
            "placeholder": null,
            "layout": null
        },
        {
            "fieldType": "FormField",
            "id": "fromDate",
            "name": "From Date",
            "type": "date",
            "value": null,
            "required": true,
            "readOnly": false,
            "overrideId": true,
            "placeholder": null,
            "layout": null
        },
        {
            "fieldType": "FormField",
            "id": "toDate",
            "name": "To Date",
            "type": "date",
            "value": null,
            "required": true,
            "readOnly": false,
            "overrideId": true,
            "placeholder": null,
            "layout": null
        }
    ],
    "outcomes": [],
    "outcomeVariableName": null
}

data-9.json:

{
  "action": "complete",
  "assignee": "rob.ferguson",
  "formDefinitionId": "c064ca14-3298-11ea-85ef-0242ac110004",
  "variables": [
    {
      "id": "employeeNumber",
      "name": "employeeNumber",
      "type": "integer",
      "value": 123456
    },
    {
      "id": "givenName",
      "name": "givenName",
      "type": "string",
      "value": "Rob"
    },
    {
      "id": "familyName",
      "name": "familyName",
      "type": "string",
      "value": "Ferguson"
    },
    {
      "id": "fromDate",
      "name": "fromDate",
      "type": "date",
      "value": "2019-12-23"
    },
    {
      "id": "toDate",
      "name": "toDate",
      "type": "date",
      "value": "2020-01-13"
    }
  ],
  "outcome": "completed"
}

POST runtime/tasks

curl -H "Content-Type: application/json" \
     -X POST http://flowable-rest:test@localhost:8080/flowable-task/process-api/runtime/tasks/40ac7f4b-32b4-11ea-85ef-0242ac110004 \
     -d "@data-9.json"

Issues

GET runtime/tasks/{formId}/form returns “type”: “text”
POST runtime/tasks/{taskId} accepts “type”: “string”

Output:

{
    "message": "Bad request",
    "exception": "Converter can only convert strings"
}

GET runtime/tasks/{formId}/form returns:

        {
            "fieldType": "FormField",
            "id": "employeeNumber",
            "name": "Employee Number",
            "type": "integer",
            "value": null,
            "required": true,
            "readOnly": false,
            "overrideId": true,
            "placeholder": null,
            "layout": null
        }

POST runtime/tasks/{taskId} accepts:

    {
      "id": "employeeNumber",
      "name": "employeeNumber",  // "Employee Number"
      "type": "integer",
      "value": 123456
    }

Output:

{
    "message": "Bad request",
    "exception": "Form field employeeNumber is required, but no value was found"
}

Ref: POST /runtime/tasks/{taskId}