Hi,
I'm a bit stumped with a situation I have here.
I fire an event off OrderGranted for some PWOs.
Depending on whether a user had any resource or no resources at the point of the new OrderGranted I need to do a different thing on this event.
This works fine if I subscribe to and approve one thing at a time.
The problem is that if a user requests, say two things and then the approver approves both of them at once, I need to fire one event that is aware that the user has no resources and then a second event that is aware that the user has 1 resource. The concurrency is causing a problem in that both these Order Granted events fire and at that point the user doesn't have any resource so my event runs twice as if the user has no resources but I need it to fire first acting as if the user has no resources and then a second as if the user has one resource. So I need it to fully complete the first event and have the user be assigned the resource and then the second OrderGranted event process see that the user has a resource already and do something a little different.
If together with the check for if a user has a resource, I also checked to see if there were any in flight PWOs, in this case I would see that there was in flight PWOs but this would trigger the event for when a user does have a resource twice when I want to fire the first event(user has no resource) and then the second event(user has at least one resource).
Is there anything I've missed here or a way I can have this logic implemented?