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

Hello, does anybody know if the order placing from frontend in spryker (via Zed Client) is generall

UPWG9AYH2
UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet

Hello,
does anybody know if the order placing from frontend in spryker (via Zed Client) is generally intended to be decoupled from the OMS in backend?
So my expectation is that when placing an order after checkout, the order is created in backend as “new” and the yves zed client gets a response. The follow up processing is done by zed via cronjobs etc.
At the moment it feels like that any OMS step, that has an onEnter=true flag, is executed as well along the zed request from frontend. This might lead to timeouts if there are expensive follow up OMS steps. Is this behaviour correct or do i miss something here? If yes, how to “decouple” it from the frontend placement so that the user experience a fast checkout? It seems it can be solved using various intermediate states and condition plugins, but honestly it feels a bit overkill just for “decoupling” the first “new” state from the further order processing.
Best

Comments

  • U01T075RRHD
    U01T075RRHD Posts: 118 🧑🏻‍🚀 - Cadet

    You are right, onEnter events will be executed right away. You can decouple from the execution of the state machine if you introduce an intermediate transition that doesn't have an event. This transition will be performed on the first check-condition execution

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet
    edited June 2021

    Okay, so omit the event for example


    new
    ready for export

    And in the IsReadyForExport we return just “true” and the next oms condition check cron run will pick this up?

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 🧑🏻‍🚀 - Cadet

    if it’s always “true” - then you don’t even need a condition. Only transition w.o. event, and oms:check-condition will take care of running it.
    oms:check-condition takes care not only of processing “conditions” but also all the transitions w.o. events.

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet
    edited June 2021

    oms:check-condition takes care not only of processing “conditions” but also all the transitions w.o. events.

    Ah okay, i think that was the missing part … so to sum it up. the check condition console command executes all possible transitions that have no event applied to it … if the transition has an additionally condition, the transition is only executed if the condition returns true … but omitting the condition means in fact “return true” by default

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 🧑🏻‍🚀 - Cadet

    exactly

  • UPWG9AYH2
    UPWG9AYH2 Posts: 509 🧑🏻‍🚀 - Cadet

    Nice one 🙂 Thanks a lot guys 🙂