Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 1.44 KB

state_machine.md

File metadata and controls

48 lines (35 loc) · 1.44 KB

Configuring a state machine

{% hint style="warning" %} This section is deprecated. However, as of now, the Sylius E-Commerce project is still resorting to this configuration so you might want to check it out. {% endhint %}

You can either use Symfony workflow or Winzou state machine. The recommended way is to use the Symfony workflow component.

If only Symfony workflow is on your requirements you have nothing to do.

But you can configure it explicitly:

Configuring Symfony workflow as state machine`

sylius_resource:
    settings:
        state_machine_component: symfony

Configuring Winzou as state machine`

If Winzou state machine is on your requirements you have nothing to do even if Symfony workflow is on your requirements too.

But you can configure it explicitly:

sylius_resource:
    settings:
        state_machine_component: winzou

Applying a transition`

You can create a route to apply any transition

app_pull_request_apply_transition:
    path: /pull-requests/{id}/{transition}
    methods: [PUT]
    defaults:
        _controller: app.controller.pull_request:applyStateMachineTransitionAction
        _sylius:
            state_machine:
                #graph: pull_request # name of the graph for Winzou or workflow name for Symfony (optional)
                transition: $transition