Home > Forum > Plugins > Location based reservation system

Location based reservation system
0

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

MVP

Hi Nik,

1) The DET_ID of each item list row is unique for the whole database. Can't you use this one? If it could be text, you could store a GUID in a technical field and use this one.

2) The action on the trigger "Upon instance saving" will not be triggered during path transition. Can you update to BPS 2022? In this case you can create an automation template with all the actions you want, and reuse this template in side the path. So you only have a single place, the automation template, which needs to be changed. This will even reduce the "cluttering" of action templates. In the past I would have added multiple action template, for the actions in the screenshot so that I can reuse them in the path. With BPS 2022 I only need to create the automation template.
This would also have the benefit, that the automation can "react" on any errors returned by the SOAP action. :)

Best regards,
Daniel