Hi,
I'd like to know if see if processes can be synchronised, with one instance waiting for another to release a lock, akin to the Java synchronized keyword or semaphore/mutexes. I know that process instances can be serialised when called from a single subprocess, but that is not quite the problem we have.
The scenario is that we have multiple process models calling a single re-usable subprocess. However, that subprocess cannot support multiple instances. The reason for this is the work it is doing. It is an integration service that links to our RPA environment. This subprocess does three things
This subprocess works, however, the RPA platform only allows a single login at a time. That means the login at step 1 invalidates all other tokens in use by the user. Therefore, if two of these subprocesses start (from the same or different main processes), the first will login, proceed to step 2, the second will login and invalidate the token of the first. Step 3 of the first process will then fail.
We don't have time-control over the processes in question as they are started from both timers and ad-hoc processes. Hence I was thinking to find some kind of waiting lock and unlock.
We've explored some ideas already, but nearly all have downsides:
I'm not sure if any of the message passing can help with this.
Thanks in advance,Tim
Discussion posts and replies are publicly visible
Thanks for the suggestions everyone. In the end, we used the Appan "increment constant" smart service. We basically set a constant to zero, then incremented it by 1 to lock. If the value returned from the increment constant is greater than one, then it does a retry backoff loop. At the end of the process it increments a constant by -1. This creates a mutex around the whole process. It's not the cleanest because we had to introduce a polling loop, but it does an incremental backoff by delaying until
now() + intervalds(0,0, (pv!pvRetry*10) + (tointeger(rand() * 10)) )
This is the process.
It's a nice compromise as your polling isn't across the Network (which I always picture as a whole crowd of people shouting across a noisy room "Is there any work for me to do?", which you can imagine simply doesn't scale very well!)