From 2b43a65b8e88299c6fb2150c6aced8cafa4f05c6 Mon Sep 17 00:00:00 2001 From: Andrey Tkachenko Date: Wed, 18 Dec 2024 17:22:27 +0100 Subject: [PATCH 1/5] Update common-pitfalls-in-oms-design.md updated OMS processes --- .../common-pitfalls-in-oms-design.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md b/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md index e5308931e6f..9272c2717a4 100644 --- a/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md +++ b/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md @@ -27,17 +27,17 @@ This document describes the most common issues with OMS design and how you can f **Issue**: If there is more than one onEnter transition event from state A, only one is executed. -![img](https://spryker.s3.eu-central-1.amazonaws.com/docs/scos/dev/back-end-development/data-manipulation/datapayload-conversion/state-machine/common-pitfalls-in-oms-design/oms-issue-1.png) +![img](https://i.ibb.co/7CWt81g/oms-processing-1-1.png) **Reason**: This behavior is not supported because there must always be only one state after an event execution. **Solution**: If you have different commands, you can chain those: -![img](https://spryker.s3.eu-central-1.amazonaws.com/docs/scos/dev/back-end-development/data-manipulation/datapayload-conversion/state-machine/common-pitfalls-in-oms-design/oms-issue-1-fixed.png)) +![img](https://i.ibb.co/23rpnHV/oms-processing-2.png)) If you have the same commands, then one of the commands could get a condition: -![img](https://spryker.s3.eu-central-1.amazonaws.com/docs/scos/dev/back-end-development/data-manipulation/datapayload-conversion/state-machine/common-pitfalls-in-oms-design/oms-issue-1-solution-2.png) +![img](https://i.ibb.co/DYHWY6w/oms-processing-3.png) @@ -66,7 +66,7 @@ In the OMS drawing, you will see the last *read* event definition, but during th **Issue**: There are many states with only outgoing transitions. -![img](https://spryker.s3.eu-central-1.amazonaws.com/docs/scos/dev/back-end-development/data-manipulation/datapayload-conversion/state-machine/common-pitfalls-in-oms-design/oms-issue-2.png) +![img](https://i.ibb.co/Np0d6rF/oms-processing-4.png) **Reason**: Function `OmsConfig:getInitialStatus` has only one return value, so it's impossible to start from another "initial" state. @@ -97,7 +97,7 @@ Process/Process.php:198) **Solution:** Removing duplicate flag `main` fixes the process rendering and processing: -![img](https://spryker.s3.eu-central-1.amazonaws.com/docs/scos/dev/back-end-development/data-manipulation/datapayload-conversion/state-machine/common-pitfalls-in-oms-design/oms-issue-7-fixed.png) +![img](https://i.ibb.co/DwPryLC/oms-processing-5.png) ## More than one transition with the same events and without condition @@ -187,7 +187,14 @@ Running this code inside a DB transaction make the lock entries inaccessible. Th **Solution:** OMS processes are cached by default. If `OmsConstants::ENABLE_PROCESS_CACHE` is not set to false in configuration files, you need to regenerate the cache every time you update OMS configuration. + To regenerate the cache, run the following command: ```bash vendor/bin/console oms:process-cache:warm-up ``` + +## Improve performance of the place order by not executing the OMS processing synchronously. +This will ensure that OMS processing will instantly stop after order creation. +Actual processing of the OMS will happen after the next execution of the `oms:check-condition` command. + +![img](https://i.ibb.co/ssv8Zgc/oms-Slow-order-placement.png) From 6212c647e456b1130f010c3bae62661529b9472f Mon Sep 17 00:00:00 2001 From: Andrii Tserkovnyi Date: Wed, 15 Jan 2025 14:21:20 +0800 Subject: [PATCH 2/5] Update common-pitfalls-in-oms-design.md --- .../state-machine/common-pitfalls-in-oms-design.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md b/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md index 9272c2717a4..fb93364c8e4 100644 --- a/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md +++ b/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md @@ -27,17 +27,17 @@ This document describes the most common issues with OMS design and how you can f **Issue**: If there is more than one onEnter transition event from state A, only one is executed. -![img](https://i.ibb.co/7CWt81g/oms-processing-1-1.png) +![img](https://spryker.s3.eu-central-1.amazonaws.com/docs/pbc/all/order-management-system/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md/oms-processing-1.png) **Reason**: This behavior is not supported because there must always be only one state after an event execution. **Solution**: If you have different commands, you can chain those: -![img](https://i.ibb.co/23rpnHV/oms-processing-2.png)) +![img](https://spryker.s3.eu-central-1.amazonaws.com/docs/pbc/all/order-management-system/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md/oms-processing-2.png) If you have the same commands, then one of the commands could get a condition: -![img](https://i.ibb.co/DYHWY6w/oms-processing-3.png) +![img](https://spryker.s3.eu-central-1.amazonaws.com/docs/pbc/all/order-management-system/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md/oms-processing-3.png) @@ -66,7 +66,7 @@ In the OMS drawing, you will see the last *read* event definition, but during th **Issue**: There are many states with only outgoing transitions. -![img](https://i.ibb.co/Np0d6rF/oms-processing-4.png) +![img](https://spryker.s3.eu-central-1.amazonaws.com/docs/pbc/all/order-management-system/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md/oms-processing-4.png) **Reason**: Function `OmsConfig:getInitialStatus` has only one return value, so it's impossible to start from another "initial" state. @@ -97,7 +97,7 @@ Process/Process.php:198) **Solution:** Removing duplicate flag `main` fixes the process rendering and processing: -![img](https://i.ibb.co/DwPryLC/oms-processing-5.png) +![img](https://spryker.s3.eu-central-1.amazonaws.com/docs/pbc/all/order-management-system/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md/oms-processing-5.png) ## More than one transition with the same events and without condition From 5cc05977124df8d14f7136e2c0305fb45c33605e Mon Sep 17 00:00:00 2001 From: Andrii Tserkovnyi Date: Wed, 15 Jan 2025 14:28:45 +0800 Subject: [PATCH 3/5] Update common-pitfalls-in-oms-design.md --- .../state-machine/common-pitfalls-in-oms-design.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md b/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md index fb93364c8e4..c203a4cda91 100644 --- a/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md +++ b/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md @@ -193,8 +193,8 @@ To regenerate the cache, run the following command: vendor/bin/console oms:process-cache:warm-up ``` -## Improve performance of the place order by not executing the OMS processing synchronously. -This will ensure that OMS processing will instantly stop after order creation. -Actual processing of the OMS will happen after the next execution of the `oms:check-condition` command. +## Optimize order placement performance + +To speed up order placement, you can configure OMS to be executed asynchronously with order placement. After an order is created, OMS processing stops, enabling the order to be created quicker. The OMS processing of the order happens after the `oms:check-condition` command is executed. ![img](https://i.ibb.co/ssv8Zgc/oms-Slow-order-placement.png) From 90b2132d5bcc62030885c7d09c5b6a2a3e0f8400 Mon Sep 17 00:00:00 2001 From: Andrii Tserkovnyi Date: Wed, 15 Jan 2025 17:03:28 +0800 Subject: [PATCH 4/5] Update common-pitfalls-in-oms-design.md --- .../state-machine/common-pitfalls-in-oms-design.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md b/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md index c203a4cda91..11f354faa37 100644 --- a/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md +++ b/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md @@ -197,4 +197,4 @@ vendor/bin/console oms:process-cache:warm-up To speed up order placement, you can configure OMS to be executed asynchronously with order placement. After an order is created, OMS processing stops, enabling the order to be created quicker. The OMS processing of the order happens after the `oms:check-condition` command is executed. -![img](https://i.ibb.co/ssv8Zgc/oms-Slow-order-placement.png) +![img](https://spryker.s3.eu-central-1.amazonaws.com/docs/pbc/all/order-management-system/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md/oms-slow-order-placement.png) From a5104a9b2b10f3dc6f88bda3645eb2f348a0d71a Mon Sep 17 00:00:00 2001 From: Andrii Tserkovnyi Date: Wed, 15 Jan 2025 17:04:27 +0800 Subject: [PATCH 5/5] Update common-pitfalls-in-oms-design.md --- .../state-machine/common-pitfalls-in-oms-design.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md b/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md index 11f354faa37..39529c9fd72 100644 --- a/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md +++ b/docs/pbc/all/order-management-system/202410.0/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md @@ -197,4 +197,4 @@ vendor/bin/console oms:process-cache:warm-up To speed up order placement, you can configure OMS to be executed asynchronously with order placement. After an order is created, OMS processing stops, enabling the order to be created quicker. The OMS processing of the order happens after the `oms:check-condition` command is executed. -![img](https://spryker.s3.eu-central-1.amazonaws.com/docs/pbc/all/order-management-system/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md/oms-slow-order-placement.png) +![optimized-oms-for-order-placement](https://spryker.s3.eu-central-1.amazonaws.com/docs/pbc/all/order-management-system/base-shop/datapayload-conversion/state-machine/common-pitfalls-in-oms-design.md/oms-slow-order-placement.png)