What are the Slack Archives?
Itโs a history of our time together in the Slack Community! Thereโs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonโt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hi guys, currently working on OMS and statemachine. One thing that bugs me: Suppose I have the follo
Hi guys,
currently working on OMS and statemachine.
One thing that bugs me:
Suppose I have the following state machine:
<?xml version="1.0"?> <statemachine xmlns="spryker:oms-01" xmlns:xsi="<http://www.w3.org/2001/XMLSchema-instance>" xsi:schemaLocation="spryker:oms-01 <http://static.spryker.com/oms-01.xsd>"> <!-- Used as example XML for OMS implementation --> <process name="Demo01" main="true"> <states> <state name="new" /> <state name="unauthorized" /> <state name="paid" /> </states> <transitions> <transition condition="Demo/IsAuthorized" happy="true"> <source>new</source> <target>paid</target> <event>pay</event> </transition> <transition><!-- else --> <source>new</source> <target>new</target> </transition> </transitions> <events> <event name="pay" onEnter="true" command="Demo/SendNotification" /> </events> </process> </statemachine>
I can't get it working, that the condition is checked at oms:check-condition
.
Here statemachine is picking up only conditions. that have no event:
https://github.com/spryker/oms/blob/d6cc889a6e846d08e5a423d36d44e41b38cd51ce/src/S[โฆ]pryker/Zed/Oms/Business/OrderStateMachine/OrderStateMachine.php
What I would like to achive is that, that a transition is triggered if condition Demo/IsAuthorized
is met, and then the command Demo/SendNotification
is executed.
Did I get the concept of commands and conditions wrong, that they are not working together or did I just configure something wrong? ๐ค
Comments
-
The else transition is not needed. The transition will only happen when the condition is met
0 -
then, I never saw a transition with both command and condition, not sure if that's possible
0 -
if not, try to add and intermediate state and transition to separate that
0 -
Hi @U01A5ARAXP0,
thanks for your response!
I now are doing it with a separate step, which I was trying to avoid. but now it works.0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K ๐ Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random