Assign priority to the jobs of a process instance

Hi All.

I have been using Flowable quite some time now and after spending so much time, I have finally prepared a suitable solution for my requirement.

START → FARE_CALCULATION → PAYMENT → CREATE_PASS → ACTIVATE_PASS → COMPLETION → END

Here, every service tasks - fare evaluation, deduct balance, create pass, activate pass, complete tap are configured as async job.

Now, the process shown here is started every time I get a kafka message. When I get 1 or 2 messages, it works perfectly well. But the problem is, when I have 10000 messages, the flowable saves all of them in the database first which is also acceptable.

Now, when the async executor starts picking up the service jobs, all threads starts picking up the fare calculation job and it doesnt go to the payment subprocess but keeps on picking up more fare evaluation jobs of other process instances.

So each event is stucking at first level and dont go to next level until all fare evaluations are completed. Is there a way to prioritise all the jobs of a process instance on first come first serve basis ?

like -
instance1 - fare cal (Priority=1), payment (p=2)… completion(p=5)
instance2 - fare cal (Priority=6), payment (p=7)… completion(p=10)
instance3 - fare cal (Priority=11), payment (p=12)… completion(p=15)…

Thanks in advance.

No, the Async Executor doesn’t do this, on purpose, as it would be bad for throughput performance. Any job that is created is equal, that’s the way the Async Executor can scale out significantly.

Instead of trying to add a fixed order to jobs, why not scale out the Async Executor such that all jobs get processed fast? See Handling Asynchronous Operations with Flowable – Part 3: Performance Benchmarks – Flowable Blog.