Symfony Workflow Cannot autowire service

  autowired, symfony, symfony-workflows

I’m using workflow for the first time injecting WorkflowInterface in my CommandHandler.

i get this error:

Cannot autowire service "AppMyClassMessageHandlerMyClassCommandHandler": argument "$workflow" of method "__construct()" references interface "SymfonyComponentWorkflowWorkflowInterface" but no such service exists. You should maybe alias this interface to the existing "state_machine.user" service.

Should i have to define alias in service.yaml ? Why ?

Source: Symfony Questions

LEAVE A COMMENT