Hi,
I have a process model which contains a subprocess which contains 2 user tasks.
When I create an instance of the process, I give it a variable userNames which contains a list of string (‘userA’, ‘userB’, ‘userC’)
All the tasks in the subprocess contains a variable userName.
I want to reproduce the subprocess for all entities of the variable UserNames.
Also, I want to be available to update the variable UserNames by adding userD, and the subprocess will reproduce also for the new entity userD.
Somebody can help me? Thanks a lot
You’d use the list of users as the collection passed to the MI subprocess, and the subprocess would be executed for each user. The choice is also if the multiple executions should be done in parallel or sequentially.
There is still a problem. When the allForwarderGroupIds variable is updated, I want to restart the subprocess on the same time that the first task is already running.
How do you detect these changes to the list? Are these updated external to Flowable?
If so, what about adding a signal boundary event to the subprocess and throwing the signal through the runtimeService#signalEventReceived, that then interrupts anything inside the subprocess and restarts it?
When I want to create a new list of task for new the forwarder created, I execute the signal and it launch the second subprocess (localhost:8080/flowable-task/process-api/runtime/executions/{executionId})
But, I want to be able to execute the signal many times. And I note that it is impossible.
There is a solution to be able to execute the subprocess via API many times ?
At the same time wait for a signal, when it arrives:
Execute “Booking Notification”
Execute “Submit Booking Option”
The issue with your process is that is does not know to wait for the signal again. You’d need to loop the process flow back around to the intermediate signal catching event. The issue with that set up is that the process would never know when it is done. You’d end up with something more like this:
This has the limitation that only one additional booking can be in flight at a time. If you want multiple additional bookings in flight at the same time, you end up with something like this:
If you are open to doing some of your modeling in CMMN, there is a cleaner way of modeling this kind of interaction.
In this bit of CMMN:
Completion of the “Collect Initial List Of Bookings” task activates the “Booking Notification Stage”
As soon as the stage activates, the “Notify Booking List” Process Task executes.
This starts a BPMN process to handle the initial list.
Also in the stage, there is a manually activated, repeatable, process task called “Notify Additional Booking”
When the task is activated, it begins a BPMN process to Notify Additional Booking items
Since the stage is not auto-terminating it remains active until it is manually ended. You could also use an exit sentry so that some other event in the case closes the stage.
Thanks, but right now I prefer the use the bpmn model. The first model is what I want to use.
But I have a problem. The second parallel gateway don’t continue to the “Add booking” signal. So I can’t access it. I don’t understand where is the problem.
There does seem to be an issue with using two parallel gateways back to back like this. Switching the second gateway to an inclusive gateway seems to make it work.
Once you complete the subprocess, the flow will go back through the inclusive gateway and hit the intermediate catching event again. If you want it to be triggerable before the subprocess completes, you’ll need to fork the execution before your subprocess and direct a sequence flow back to the inclusive gateway from there.