This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Check If There Is An Outstanding PWO

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?

Parents
  • My process required information from the PWO such as the uid_personhead and firing an event from PersonHasQERResource there is only a weak link back to the PWO table. I guess I could use the most recent PWO for the resource in question but that seemed to weakly correlated for me. With some help, I solved the problem by pulling the PWOs in the Assigned state and then some ordering logic to define which one should be treated as 'first' in any case.
Reply
  • My process required information from the PWO such as the uid_personhead and firing an event from PersonHasQERResource there is only a weak link back to the PWO table. I guess I could use the most recent PWO for the resource in question but that seemed to weakly correlated for me. With some help, I solved the problem by pulling the PWOs in the Assigned state and then some ordering logic to define which one should be treated as 'first' in any case.
Children
No Data