question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

POST /runtime/tasks/{taskId}

See original GitHub issue

Using Flowable’s REST API to complete a User task:

curl -H "Content-Type: application/json" 
     -X POST http://admin:test@localhost:8080/flowable-task/process-api/runtime/tasks/1fae489a-070f-11e9-a85e-0242ac110002
     -d "@data-1.json"

data-1.json:

{
  "action" : "complete",
  "variables" : [
    {
        "id": "givenName",
        "name": "Given Name",
        "type": "string",
        "value": "Rob"
    },
    {
        "id": "familyName",
        "name": "Family Name",
        "type": "string",
        "value": "Ferguson"
    },
    {
        "id": "employeeNumber",
        "name": "Employee Number",
        "type": "integer",
        "value": 123456
    },
    {
        "id": "fromDate",
        "name": "From Date",
        "type": "date",
        "value": "2018-12-21T00:00:00+00:00"
    },
    {
        "id": "toDate",
        "name": "To Date",
        "type": "date",
        "value": "2019-01-07T00:00:00+00:00"
    }
  ]
}

Returns:

Status: 200 OK

Despite returning OK it doesn’t appear to save the User task’s form data:

blank-form

See: https://robferguson.org/blog/2018/12/24/flowable-rest-api-part-1/

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:22 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Robinyocommented, Jan 10, 2020

After a bit more trial and error I got it to work 😃

Sample payload:

{
  "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-22T13:00:00.000Z"
    },
    {
      "id": "toDate",
      "name": "toDate",
      "type": "date",
       "value": "2020-01-09T13:00:00.000Z"
    }
  ],
  "outcome": "completed"
}

formDefinitionId is the id attribute returned from GET runtime/tasks/{taskId}/form

Also:

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"
}

And:

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"
}
1reaction
xcaptaincommented, Jan 7, 2019

@tijsrademakers I tested the latest source code, GET /runtime/tasks/{taskId}/form works fine for active tasks, but for completed tasks this api returns task not found

Read more comments on GitHub >

github_iconTop Results From Across the Web

POST /runtime/tasks/{taskId} - Flowable Engine
I used Flowable Task to create a process instance. GET runtime/tasks curl -H "Content-Type: application/json" \ -X GET ...
Read more >
Solved: Reassign a task - Alfresco Hub
we must call the two REST APIs in order. 1. unclaim. POST runtime/tasks/%taskId%. { "action": "claim",
Read more >
POSTPROCESSOR BUILDING - "Get the code you want by ...
POSTPROCESSOR BUILDING - "Get the code you want by customizing your posts with Post Builder" Więcej o NX CAM: https://gmsystem.pl/nx-cam/
Read more >
Modelos y algoritmos para minería de procesos y datos - Colibri
POST form/form-data: Completar datos de un formulario a partir de un ... un put del servicio “/activiti-rest/service/runtime/tasks/taskId” de Activiti Rest.
Read more >
3. Configuring Post Functions - Innovalog
Jira workflow post functions carry out rules after a transition is executed. Post functions are the most common workflow extensions used for automating ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found