Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Decoupling of Checkout endpoint and OMS commands to architectur… #2982

Merged
merged 11 commits into from
Jan 17, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,13 @@ One can avoid using the unnecessary transitions by:
- Removing the *Reservation* flag from the NEW and other steps in the OMS.
- Removing the *Timeout* transition from the NEW step in the OMS.

{% info_block warningBox %}

Decoupling of Checkout endpoint and OMS commands:
[Slow Checkout endpoint](/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.html)

{% endinfo_block %}

### Performance checklist

Make sure to check the following articles on how to optimize the performance of your application:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,35 @@ To regenerate the cache, run the following command:
```bash
vendor/bin/console oms:process-cache:warm-up
```

## Slow Checkout endpoint

**Issue:** During the checkout process, order items are created by default in the status `new` and immediately become part of the Order Management System (OMS) workflow.
Any `onEnter` event with command from the state `new` will be executed within the same PHP process as the checkout.
This can significantly increase processing time of the checkout request and may lead to issues.

![img](./images/coupled_new_state_to_command.png)

**Solution:** It's recommended to postpone all subsequent transitions from the `new` state.

![img](./images/decoupled_new_state_from_command.png)

```
<transitions>
<transition happy="true">
<source>new</source>
<target>ready for confirmation</target>
</transition>
<transition happy="true">
<source>ready for confirmation</source>
<target>confirmation sent</target>
<event>confirmation</event>
</transition>
</transitions>
<events>
<event name="confirmation" onEnter="true" command="Oms/SendOrderConfirmation"/>
</events>
```

This approach ensures that these transitions are executed in the background by Jenkins triggering `console oms:check-condition`,
improving overall performance of the checkout process.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading