Symfony

Workflow Component

State machines, workflows, places, transitions, guards, event listeners, marking store

18 perguntas de entrevistaยท
Mid-Level
1

What is a Workflow in Symfony?

Resposta

A Workflow in Symfony is a process model that defines the steps (places) and actions (transitions) an object can follow. It manages complex flows where an object can potentially be in multiple states simultaneously, unlike a state machine. The Workflow is based on Petri net concepts and suits business processes with parallel paths.

2

What is the main difference between a Workflow and a State Machine in Symfony?

Resposta

The fundamental difference lies in the number of simultaneous states possible. A State Machine allows only one active state at a time (single_state), ideal for linear flows like an order lifecycle. A Workflow allows multiple simultaneous states (multiple_state), suited for parallel processes like document validation by multiple departments.

3

How to define the Workflow type in Symfony's YAML configuration?

Resposta

The workflow type is defined via the type option in YAML configuration under framework.workflows.[name]. The two possible values are workflow to allow multiple simultaneous states, or state_machine to allow only one active state. This choice automatically impacts the marking store type used.

4

What is a place in the context of Symfony's Workflow component?

5

How to define a transition in Symfony's Workflow configuration?

+15 perguntas de entrevista

Domine Symfony para sua proxima entrevista

Acesse todas as perguntas, flashcards, testes tecnicos, exercicios de code review e simuladores de entrevista.

Comece gratis