How to initiate a workflow in Activiti using REST API

后端 未结 1 380
我在风中等你
我在风中等你 2021-01-07 15:41

I have created a Activit Process using Service Tasks etc with eclipse and deployed the .bar to Activiti which is running on tomcat. It was successfully deployed I can start

相关标签:
1条回答
  • 2021-01-07 15:56
    • For your first question check this guide for further details:

      POST runtime/process-instances should be your endpoint (Be sure to make a POST request, with application/jsonas your content type)

      The payload on the other hand should be formatted in one of three templates:

      Request body (start by process definition id):

      { "processDefinitionId":"oneTaskProcess:1:158", "businessKey":"myBusinessKey", "variables": [ { "name":"myVar", "value":"This is a variable", } ] }

      Request body (start by process definition key):

      { "processDefinitionKey":"oneTaskProcess", "businessKey":"myBusinessKey", "tenantId": "tenant1", "variables": [ { "name":"myVar", "value":"This is a variable", } ] }

      Request body (start by message):

      { "message":"newOrderMessage", "businessKey":"myBusinessKey", "tenantId": "tenant1", "variables": [ { "name":"myVar", "value":"This is a variable", } ] }

    • As for your second issue, you should be aware that the OOTB (Out Of The Box) config may involve automatic DB cleaning upon each and every restart, you need to locate that config and override it with values of your choice! Check this section for further info, the databaseSchemaUpdate param might be exactly what you are looking for!

    0 讨论(0)
提交回复
热议问题