0

I have a scenario, There are multiple http tasks one-after-other, The other http tasks will be called only after the current running http task receives (200 or 201 or 202) success response from the API.

How to handle this scenario?

what is the use of Execute Parallel in same transaction flag in http task mean?

Pent Terry
  • 101
  • 9

1 Answers1

1

You can configure the http task with fail/handle status codes for the HTTP task and configure the for 4xx/5xx events. For fail, it will rollback the transaction and it will not persist anything. For handle, you can configure a boundary event and do process logic depending on your needs. Often the 5xx are configured as fail, while the 4xx are configured as handle.

Typically the execution in Flowable happens in one transaction and with that in one thread. When you use a parallel gateway it looks like that tasks are in parallel, however due to the single thread one request is executed after each other. Configuring "Execute Parallel in same transaction" means that it will start a separate thread for the HTTP request to ensure that multiple parallel elements are happening parallel. This is only relevant when you have a parallel gateway or in some other way two parallel HTTP tasks in the same transaction.

  • Thank You. In my use-case, these Http Tasks are the last tasks. In case of success HTTP response I need end the process. If there are some errors, then I do not want to end the process. I need to keep the current running task as Http task (As like as User Task, if there is any error in completing the user task, the user tasks won't get completed and it will remain as current running task. The same mechanism I want to have it in Http Task). Is it possible in Http task or Is there any way to handle this? – Pent Terry Mar 01 '23 at 20:16
  • You can mark the task as asynchronous, which will start a new transaction. With that, it will stay at the task in case there are any errors and retry it by default three times. After those retries, it will create a deadletter job which needs to be manually handled. In addition, it's required that you add the fail status codes. – Valentin Zickner Mar 02 '23 at 21:09