From 9b704d57e20072b9f5bcfbe474c99d6eb1b3a771 Mon Sep 17 00:00:00 2001
From: Carlos Pereira De Amorim
Date: Fri, 26 Jun 2020 16:09:43 +0200
Subject: [PATCH] Added function to get a specific transition
---
workflow.rst | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/workflow.rst b/workflow.rst
index 376996534ba..7521705980d 100644
--- a/workflow.rst
+++ b/workflow.rst
@@ -229,6 +229,8 @@ what actions are allowed on a blog post::
// See all the available transitions for the post in the current state
$transitions = $workflow->getEnabledTransitions($post);
+ // See a specific available transition for the post in the current state
+ $transition = $workflow->getEnabledTransition($post, 'publish');
Accessing the Workflow in a Class
---------------------------------
@@ -649,6 +651,9 @@ of domain logic in your templates:
``workflow_transitions()``
Returns an array with all the transitions enabled for the given object.
+``workflow_transition()``
+ Returns a specific transitions enabled for the given object and transition name.
+
``workflow_marked_places()``
Returns an array with the place names of the given marking.
@@ -883,6 +888,15 @@ In Twig templates, metadata is available via the ``workflow_metadata()`` functio
{% endfor %}
+
+ to_review Priority
+
+ -
+ to_review:
+
{{ workflow_metadata(blog_post, 'priority', workflow_transition(blog_post, 'to_review')) }}
+
+
+
Learn more
----------