Hello ,
Can we use “resultEnabled” to give us a response , when I complete a task . ?
Eg :
localhost:8080/rest/engine/default/task/2a4e7c45-21f9-11e8-825a-ee39770c0f13/complete
When I hit this REST-API (with the required payload ) , it returns a HTTP 204 response .
Is there any way to get a response-data from engine ?.
Summary
Thank You
1 Like
What kind of response content would you like to get?
@thorben ,
A basic response like the task is completed ., A response… That I can use to make sure the task got completed.
This is encoded in the HTTP status code. 204 means completion was successful. In cases of errors, you receive a 4xx or 5xx status code.
Hi,
Another option is you will get say an http 202 on success. You could set a process variable(s) with a value indicating some kind of outcome or value and make a subsequent REST API call to retrieve that value. For example you can get variables associated with the process instance…
regards
Rob
@Webcyberrob ,
How should i implement this ??
Hi,
So in your task implementation, you could set a process variable to a status value, eg;
execution.setVariable(“Task_Status”,“OK”)
Hence when you use the REST API to complete the task, make another REST API call to get this value. See the docs [1]
regards
Rob
[1] https://docs.camunda.org/manual/7.8/reference/rest/process-instance/variables/get-variable/