Hi Jon, I made an example model for you. And I made it very generic so that it should work in lots of situations.
The basic idea is that I treat all the components of a request like a recipe, 2 of these, 3 of those, etc. I batch together all those components into a single request. Then, that request checks for the availability of all components. If any are missing, it waits for those components before trying again. During this phase, nothing is pulled from any list; it's just a peek.
Once the token has confirmed that all are available, it executes the next phase of the process, which is to acquire everything. Since confirmation happens all at once, the items are guaranteed to be on the lists, so the actual pull (where items are removed from the list) is guaranteed to work.
The final phase is to basically put everything back where it came from. To do that, I save the request token, and have it wait until the parent releases it.
This flow should be generic enough to use in basically any model. I will say that if you are using a SELECT statement, you'd need to modify parts of it. But this should get you going.
MultiPullExample.fsm
.
Jordan Johnson
Principal Software Engineer
>