spring-bootcamundazeebe

Handling usertask in camunda/zeebe


I am new to Camunda/zeebe BPM. I am using the send-email workflow provided by Zeebe to test and play around. I am able to start the process from spring boot application and able to get the instance id information. I want to pass the message content which is defined in the user task using a RestAPI call to my custom spring boot application. It would be great if anyone can point in the right direction on the following

  1. How to pass the variable input to the user task from a spring boot application?
  2. Is there API to get the list of active task for a given instance id (for Zeebe)
  3. Is it possible to make a REST API call to Zeebe directly to provide the input for the human task with help of instance id.

Also can you point some details on how to do with Camunda server instead of Zeebe.


Solution

    1. You can define a system task with implementation as delegate expression and set the variable required in the java class. The scope of the variable would be throughout the process instance and is accessible from any user task. If you want you can specifically map variable from the Input/Output tab.

    enter image description here

    1. GET http://localhost:8080/engine-rest/task?processInstanceId=100001920009

    2. You have to list the tasks with the api in point 2 then claim the task using task id which will be in the response of point 2

    POST http://localhost:8080/engine-rest/task/7676a188-e0f4-11eb-bd9c-22a3117ba565/claim

    Then can complete the task with

    POST http://localhost:8080/engine-rest/task/7676a188-e0f4-11eb-bd9c-22a3117ba565/complete

    if variables are to be passed use the below template as the body

    {
      "variables": {
        "aVariable": {
          "value": "aStringValue"
        },
        "anotherVariable": {
          "value": 42
        },
        "aThirdVariable": {
          "value": true
        }
      },
      "withVariablesInReturn": true
    }