Calling Developers!
We are reenergizing our code contribution process! Learn More

Does it possible to open a customer order form on click of a transition in state machine?

Options
mohammed.shamim
mohammed.shamim Posts: 33 🧑🏻‍🚀 - Cadet
edited August 2023 in Spryker Development

We are using OMS module and all state/transition/event are defined within a xml file. I did't get way out that make it possble or feasible to open a customer form on click of a transition. please provide your suggestion.

Best Answer

  • Alberto Reyer
    Alberto Reyer Lead Spryker Solution Architect / Technical Director Posts: 690 🪐 - Explorer
    Answer ✓
    Options

    From what you describe, the first solution I posted might be your best option:

    What you could do is to have a check (condition in OMS) that wait's for a certain input.
    For your requirement I would add a field to the order has_been_edited or
    something alike which is set to true when the order customer form was
    sucessfully handled.

    If the order customer form is filled by a backoffice user you could do the following.
    In the backoffice I would add a new view that shows all orders that have
    not yet been filled with the order customer form, to allow the people
    that work in the backoffice to see those and fill those forms.

Answers

  • Alberto Reyer
    Alberto Reyer Lead Spryker Solution Architect / Technical Director Posts: 690 🪐 - Explorer
    Options

    OMS is designed as asynchronous, automated process engine, there is no out of the box functionality which allows user interaction.

    What you could do is to have a check (condition in OMS) that wait's for a certain input.
    For your requirement I would add a field to the order has_been_edited or something alike which is set to true when the order customer form was sucessfully handled.

    If the order customer form is filled by a backoffice user you could do the following.
    In the backoffice I would add a new view that shows all orders that have not yet been filled with the order customer form, to allow the people that work in the backoffice to see those and fill those forms.

    If the order customer form should obtain additional input from the customer, either create a form with a unique token and send a link to this form, for example via mail, from the state machine. Make sure to either skip this transition in the OMS after a certain timeout, if it is optional, or to resend the link to the form after a while if it hasn't been filled by the customer, to avoid the order being stuck in the process.
    This would be a customer facing solution for what you ask, but I don't understand why you do not obtain this input during the checkout process, assuming it's input from the customer. Is it bound to an information that is only available after an order was placed? What is the use case you try to cover here?

  • mohammed.shamim
    mohammed.shamim Posts: 33 🧑🏻‍🚀 - Cadet
    edited August 2023
    Options

    I understand customer detail could be taken at checkout step and business also understand this . But as per our current project, our sale representative actually take detail from customer using frontend portal , in that portal product to be sold fetched from provider end using API, once all info gather , complete contract detail get persisted in spryker db along with order id, but this order is created in spryker end not at provider end yet. To start process of generating order at provider , state machine run on order info received from frontend that goes though all the steps till submit order. At all these step we again calling provider api to generate customer document and etc before submit the order. In backend for every new contract submitted, its started with state in which our quality call agent call respective customer to confirm the order detail, at this step if customer want edit his detail then business want QC agent can edit that. client customer detail not stored in the order table fields like first name or lastname, instead in a order field with json data. So for editing that when QC call get confirmation from customer , business want this to be done via state machine if its feasible by adding a new state before their QC call. I hope you get bit inside now.

  • Alberto Reyer
    Alberto Reyer Lead Spryker Solution Architect / Technical Director Posts: 690 🪐 - Explorer
    Answer ✓
    Options

    From what you describe, the first solution I posted might be your best option:

    What you could do is to have a check (condition in OMS) that wait's for a certain input.
    For your requirement I would add a field to the order has_been_edited or
    something alike which is set to true when the order customer form was
    sucessfully handled.

    If the order customer form is filled by a backoffice user you could do the following.
    In the backoffice I would add a new view that shows all orders that have
    not yet been filled with the order customer form, to allow the people
    that work in the backoffice to see those and fill those forms.

  • mohammed.shamim
    mohammed.shamim Posts: 33 🧑🏻‍🚀 - Cadet
    Options

    Thanks Alberto, Let me thing over the approach you described, its really a good insight for me before actually start on the implementation. I might come up on this again once I start implementation after approval.