Can someone please suggest the ‘correct’ way of below implementation?
The first defined user task let’s the user to select some of the objects. This list is then built upon in the request and sent via HTTP post to the API. Then the process basically awaits another user action with yet another user task.
The issue here is that I need to keep the first user task open until ALL of the objects are selected. The process has to keep that task open, but also move to the HTTP post method.
Without getting much into the details of the whole process, i did try using gateways in different ways, and what I achieved is that I do in fact split the process correctly, but the user task is killed, and in order to see the changes and select more objects I have to open a new task, as the previous one has been killed.
What you are asking for is a lot like what CMMN can be used for. In CMMN you have sentries and repeatable that you can use to achieve what you are looking for. Every time you complete the User Task and / or use a User Event Listener you can start a process that will do the HTTP logic.
In any case, you cannot keep the task and progress in the same time. The action of completing the task is what moves the process further.
My understanding: user task 1 is created and meantime http requests fetch some values and then user task 2 is available and user task 1 can be completed.
Make user task 1 and http requests in parallel.
Allow to complete user task 1 only when http vars are set (check for them and throw exception on complete).
The thing is, User Task 1 and the HTTP request should not run in parallel. User Task 1 is actually providing the data that the request needs in order to work.
To give a real-life example: imagine User Task 1 as a to-do list. The user can mark each to-do building the request and sends an HTTP POST to complete those to-do.
What happens in User Task 2 doesn’t matter for our case. The main point is that, after the initial action, I want User Task 1 to remain open so the user can finish selecting the entire to-do list—sending multiple requests until everything is marked as done.
Is this feasible, or does sending a single request mean I must open an entirely new User Task 1 each time?