polysource/workflow-bridge

Polysource — Symfony Workflow bridge: auto-generates inline transition actions + state chips for resources with a Workflow attached.

Maintainers

Package info

github.com/polysource/workflow-bridge

Homepage

Issues

Type:symfony-bundle

pkg:composer/polysource/workflow-bridge

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.1 2026-05-10 21:00 UTC

This package is auto-updated.

Last update: 2026-05-10 21:01:15 UTC


README

Symfony Workflow integration for Polysource — auto-generated transition buttons + state chip per resource.

Part of the Polysource monorepo. MIT-licensed.

When to use

You're modelling an ecommerce / CRM / claims / HR / regulated workflow with symfony/workflow and want the admin UI to expose only the transitions actually enabled by the workflow guards. This package wraps Symfony's Workflow\Registry into auto-generated Polysource actions and a state chip Twig helper.

See ADR-021. Separate package so polysource/symfony-bundle doesn't pull symfony/workflow for hosts that don't use it.

What it ships

  • WorkflowAwareInterface + WorkflowAwareTrait — opt-in marker for resources.
  • WorkflowResolver — wraps Symfony Workflow Registry with graceful null-on-failure.
  • TransitionDiscovery — delegates to Workflow::getEnabledTransitions() (guards natifs Symfony intacts).
  • ApplyTransitionAction — auto-generated per transition, granular permission POLYSOURCE_WORKFLOW_TRANSITION_<UPPER>, TransitionExceptionActionResult::failure.
  • WorkflowChipPalette + WorkflowChipExtension Twig (polysource_workflow_chip_palette() + polysource_workflow_state_label()).
  • _state_chip.html.twig partial Bootstrap.
  • Config polysource_workflow_bridge.palettes.<workflow>.<state> with wildcard fallback.

Audit log (ADR-020) traces every transition for free (actionName=transition-<name>).

Install

composer require polysource/workflow-bridge symfony/workflow

Register the bundle:

return [
    Polysource\WorkflowBridge\PolysourceWorkflowBridgeBundle::class => ['all' => true],
];

Documentation