Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/adjust-acp-prerequisites-doc
Browse files Browse the repository at this point in the history
  • Loading branch information
pushokwhite authored Jan 15, 2025
2 parents b1c6c1a + 29aff84 commit e1e895f
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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://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://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://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://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://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)



Expand Down Expand Up @@ -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://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.

Expand Down Expand Up @@ -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://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

Expand Down Expand Up @@ -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
```

## 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.

![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)

0 comments on commit e1e895f

Please sign in to comment.