Trigger a `Receive Task`

I have a sample process:
Screenshot%20from%202019-05-10%2017-01-01

wait for response (Receive Task) is intended to be Triggered from a remote system (REST API call? or better way?).

I did the following:

curl -i 'http://admin:test@localhost:4000/flowable-task/process-api/runtime/executions/'
{"data":[{...}, {"id":"df2f8397-730e-11e9-8d02-0242ac1c0009","url":"http://flowable:8080/flowable-task/process-api/runtime/executions/df2f8397-730e-11e9-8d02-0242ac1c0009","parentId":"df2f3574-730e-11e9-8d02-0242ac1c0009","parentUrl":"http://flowable:8080/flowable-task/process-api/runtime/executions/df2f3574-730e-11e9-8d02-0242ac1c0009","superExecutionId":null,"superExecutionUrl":null,"processInstanceId":"df2f3574-730e-11e9-8d02-0242ac1c0009","processInstanceUrl":"http://flowable:8080/flowable-task/process-api/runtime/process-instances/df2f3574-730e-11e9-8d02-0242ac1c0009","suspended":false,"activityId":"wait_for_response","tenantId":""}],"total":4,"start":0,"sort":"processInstanceId","order":"asc","size":4}

Next I tried to select a single id

curl -i 'http://admin:test@localhost:4000/flowable-task/process-api/runtime/executions/df2f8397-730e-11e9-8d02-0242ac1c0009'
{"id":"df2f8397-730e-11e9-8d02-0242ac1c0009","url":"http://flowable:8080/flowable-task/process-api/runtime/executions/df2f8397-730e-11e9-8d02-0242ac1c0009","parentId":"df2f3574-730e-11e9-8d02-0242ac1c0009","parentUrl":"http://flowable:8080/flowable-task/process-api/runtime/executions/df2f3574-730e-11e9-8d02-0242ac1c0009","superExecutionId":null,"superExecutionUrl":null,"processInstanceId":"df2f3574-730e-11e9-8d02-0242ac1c0009","processInstanceUrl":"http://flowable:8080/flowable-task/process-api/runtime/process-instances/df2f3574-730e-11e9-8d02-0242ac1c0009","suspended":false,"activityId":"wait_for_response","tenantId":""}

BUT I am unable to trigger it, POST call failed as well.

curl -i 'http://admin:test@localhost:4000/flowable-task/process-api/runtime/executions/df2f8397-730e-11e9-8d02-0242ac1c0009' -d ""
{"message":"Internal server error","exception":"Request method 'POST' not supported"}

All the pages i got for references use /app-rest/service/ which does not work for me.

curl -i 'http://admin:test@localhost:4000/flowable-task/app-rest/service/'
HTTP/1.1 302 
...
Location: http://localhost:8080/flowable-idm/#/login?redirectOnAuthSuccess=true&redirectUrl=http://flowable:8080/flowable-task/app-rest/service/

References that didn’t work for me

I am running this flowable
Docker > image: flowable/all-in-one (latest)

1 Like

This looks to be working but my variables are lost (after receive task I have a form where these variables are used in expression but values are not substituted)

Screenshot%20from%202019-05-13%2012-47-03

curl -X PUT \
  http://localhost:4000/flowable-task/process-api/runtime/executions/6456278c-754d-11e9-a48f-0242ac1c0009/ \
  -H 'Authorization: Basic YWRtaW46dGVzdA==' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: e75a3f43-069a-4fbe-b3d9-3e9720149ffd' \
  -H 'cache-control: no-cache' \
  -d '{
  "action":"signal",
  "variables" : [
    {
      "name": "myVar",
      "value": "someValue"
    }
  ]
}'

Check Complete task

PUT request to /process-api/runtime/executions/{target_process_id}/variables/ worked great

1 Like