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

Is there any way to extend the default state machine? `DummyPayment01.xml` i mean. I need to add onl

U0145CP9Q6Q
U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

Is there any way to extend the default state machine? DummyPayment01.xml i mean. I need to add only few commands to events. I don't need the new OMS

Β«1

Comments

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    just copy it into config\Zed\oms - I think it will override the vendor one?

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    i did it already πŸ™‚ and have exception
    "DummyPayment01.xml" found in more then one location. Could not determine which one to choose. Please check your process definition location

  • Extending is not supported. You can copy paste in your own state machine and replace needed parts.

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    maybe we changed our config:

    $config[OmsConstants::PROCESS_LOCATION] = [
        OmsConfig::DEFAULT_PROCESS_LOCATION,
    ];
    
  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    so it doesn't load from the vendor?

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    (we've done the same, replaced DummyPayment01.xml)

  • no it loads from config\Zed\oms

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    ah i see πŸ™ˆ ignore me then

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    but why extending is not supported?? amazing

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    you can create subprocesses to allow reuse

  • I suppose it’s a rhetorical question πŸ™‚

  • And yes you can manage everything using subprocesses

  • DummyPayment is only example

  • All projects use their own business processes

  • So they build their own state machines

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    But i don't need my own state machine. At least at this point. I need to change only some commands.
    Guys this is pain as for me. And time wasting. Completelly unextendable system.

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    and again copypasting...

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited June 2020

    That is your own state machine? (i.e. it's project code)

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    You are free to modify it?

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    yes. but all developers trying to avoid code duplication. but not spryker. this is separate topic

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    you can use subprocesses to avoid duplication

  • UKGT7RC7P
    UKGT7RC7P Posts: 538 πŸ§‘πŸ»β€πŸš€ - Cadet

    (think of them like traits)

  • UKHR9UN00
    UKHR9UN00 Posts: 70 πŸ§‘πŸ»β€πŸš€ - Cadet

    @U0145CP9Q6Q Please have look at the State Machine Cookbook https://documentation.spryker.com/docs/state-machine-cookbook
    This is a pretty good resource for the state machine.

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    thanks

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    wait.. config/Zed/oms/DummyPayment01.xml *is* already your project state-machine. So just change it. Introduce commands you need right there, there is nothing to extend

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet

    ..and DummyPayment was meant to be there just for the start of your development, just as you want it. And later on, you will introduce the right one, that will be used on production.

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    yes. i did like this. also had to remove the path to vendor dummy payment from config.

  • U0145CP9Q6Q
    U0145CP9Q6Q Posts: 123 πŸ§‘πŸ»β€πŸš€ - Cadet

    now it is ok

  • Valerii Trots
    Valerii Trots SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
    edited June 2020

    wait.. config/Zed/oms/DummyPayment01.xmlΒ isΒ already your project state-machine

    That is missing in https://github.com/spryker-shop/b2b-demo-shop/tree/master/config/Zed/oms but present in https://github.com/spryker-shop/suite/tree/master/config/Zed/oms.

    We have some incosistencies between our demoshops I would say and we need to fix it.

  • Andriy Netseplyayev
    Andriy Netseplyayev Domain Lead Solution Architecture Sprykee Posts: 519 πŸ§‘πŸ»β€πŸš€ - Cadet