Hi all!
We have a workflow (service order) containing an item list, which represents a shopping basket.
We have a workflow containing several sales locations, which can create service orders for their location.
Every time the shopping basket changes we need to send (delta) reservations to an external system with a SOAP request.
So far so good, this is a common scenario ;-)
What we have so far:
A custom action (SDK) which builds (delta) reservation XML to be sent to external system (SOAP). If there is no change in shopping basket, we are storing an empty string to an internal field (XML content), so that upcoming SOAP request can be conditionally executed or not.
We are facing some challenges here:
1.) External system needs a reservation number, which should be unique across one sales location, so every request needs to generate a ongoing number within one store or sales location
Sales Location 0001 -> 1,2,3,4,5,6,.... max. 999999
Sales Location 0002 -> 1,2,3,4,5,6,.... max. 999999
.
.
.
Is there a way to generate a unique number for each sales location in a custom action, and if how? We thought about executing an update sql statement on workflow containing sales locations incrementing a certain number field. Btw. this should be thread safe ;-)
2.) Instead of putting this reservation actions (custom action + SOAP action) in each path, we thought about having this as a global action (Upon instance saving). Is this possible and will it be triggered on each event (save button, path transition)?
I hope the question is clear enough, looking forward to your input.
Thanks in advance & best regards, Nik