By default, only one background job will run on a process at one time (as the exclusive flag defaults to true). It is easy to limit a process instance to only run one foreground process (e.g. completing a task) at a time by implementing locking before the call to the engine is made. This gives quite a lot of flexibility.
However, sometimes I want to make a background job exclusive with a foreground process. For example, if someone sends a message that updates a timer, I don’t want to process that update immediately if there’s currently a background job running due to that timer having expired, I want to wait until the background job has finished.
One option would be to let one of the jobs fail and retry it but I will sometimes have side effects that are difficult or impossible to roll back.
Is this a problem that others have already solved? I am currently using 5.22 but we will eventually migrate to Flowable 6.