This article shows how to control how many sessions can run at the same time for a given delivery.
The method
It is possible to limit the number of parallel executions of a process by setting the property nbMaxParallelSessions in the Meta-Inf of the Process.
This parameter limits the number of parallel executions for a given Delivery, within a given Runtime. The other sessions are queued by this Runtime and they will start progressively as the previous sessions end.
The sample process
For this example, we have a child process, which can last a random duration between 1 and 30 seconds.
Expression of the SLEEP_DELAY = %e(rhino){(1000*Math.floor(1+Math.random() * 30)).toString()}e(rhino)%
Notice the Property "Meta-Inf" : <nbMaxParallelSessions>10</nbMaxParallelSessions>
This property will prevent this process from being executed more than 10 times in parallel.
The main process has a SqlOperation which retrieves 35 rows from a table.
The bound action executes the "parallel-child" delivery in "Asynchronous mode".
Execution
Here is what happens when executing the "parallel" process :
All the necessary sessions are prepared.
The Runtime executes these prepared sessions, but "holds" them so that there is no more than 10 sessions at the same time.
Comments
Are you sure about the fact that the Runtime checks for already running sessions for "the same delivery" only?
If I have two completely different deliveries having both "nbMaxParallelSessions set to 1", then it is impossible to have both deliveries running at the same time on the same runtime.
I was expecting to be able to use this setting to prevent the same delivery to execute in parallel (with itself), but keep the possibility to run different deliveries in parallel.
Any other ways to achieve this?
Kind Regards,
--
Nicolas.
But if two different deliveries are run manually or scheduled almost at the same time (so run separatly), then the second delivery wait for the end of the first one.
Support ticket with more details created