A workflow component with framework integration coming in Symfony 3.2
In the Symfony world there have been alternatives for creating workflows like this, but with the upcoming release the Symfony project will have a dedicate component for creating and visualising workflows.
The work has been underway since 2014 by Grégoire Pineau, but things moved forward in the past weeks as the workflow component is to be included in Symfony 3.2 with complete integration to the full stack framework.
The component allows developers to define workflows like publishing and approval in a unified way using code or alternatively configuration when using the Symfony full stack framework:
framework: workflows: article: marking_store: type: property_accessor supports: - AppBundle\Entity\Article places: - draft - wait_for_journalist - approved_by_journalist - wait_for_spellchecker - approved_by_spellchecker - published transitions: request_review: from: draft to: - wait_for_journalist - wait_for_spellchecker
In addition to pure code or configuration views, developers can visualize their workflows to make them more accessible. An sample visualisation is the one below is implemented in the example application from Grégoire presented at Symfony Live Paris this April. It displays the current state of an article in a publishing workflow:
Together with the Symfony Expression Language the workflow component will enable developers to add commonly needed functionalities to their applications such as editorial workflows in CMSes without constant reinvention of the wheel.
The new component is hardly the only option for creating workflows in PHP or Symfony as complete solutions like the LexikWorkflowBundle and OroWorkflowBundle as well components like ZetaComponents Workflow and Alter Way Workflow.
The track record that Symfony has for stability and support makes the new component a worthwhile option in the long term. It is worth noting that the Symfony 3.2 release is not due until November 2016, so there is still plenty of work that needs to be done with documentation and so forth.
At this point the best place to learn about the upcoming Symfony Workflow component are:
- The source code on GitHub
- The original Pull Request
- A running example application
- The source code of the example application