How to get the response back from task to the start task

@Praveen_Kumar_Reddy Thanks for your suggestion for the version upgrade but we are using java 8 in our project.

I think I have not conveyed my problem properly, What I want to achieve is, to get the response back to the caller API, like normal asynchronous REST API call.


In the above attached image, I would be triggering the process by triggering an API call with some payload for example for the given product Id I need to create an order. So I will be calling the below API

api/v1/test/camunda with payload required for the subsequent task

By taking the product id from payload,

  1. The 1st job worker(product check) is triggered by zeebe which will have the implementation to validate the product, on success
  2. The 2nd job worker(order placement) is triggered by zeebe which will have the implementation to place order, on success
  3. The 3rd job worker(payment) is triggered by zeebe which will have the implementation for payment, on success
  4. I need to return the order id and few other details as object as response for the API api/v1/test/camunda.

In your explanation you had asked me to set the variable as responseDto but how can I pass the in request object i.e. sampleDto to the worker then? I am bit confused here.

Also if you could share any example code snippet to retrieve variable in the controller class which was set by jobworkers in subsequent tasks.