From 35d531a44c4e059fab257c46f64f6dc378f4b80e Mon Sep 17 00:00:00 2001 From: Loulier Guillaume Date: Sun, 28 Jan 2018 09:09:52 +0100 Subject: [PATCH 1/8] fix(Attribute): fix on attribute type if persisted --- workflow/usage.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/workflow/usage.rst b/workflow/usage.rst index 9396e3b95d1..bfbf1facf42 100644 --- a/workflow/usage.rst +++ b/workflow/usage.rst @@ -138,7 +138,7 @@ like this: class BlogPost { - // This property is used by the marking store + // This property is used by the marking store, by default, Symfony "mark" this attribute as an array. public $currentPlace; public $title; public $content; @@ -155,7 +155,12 @@ like this: The ``type`` (default value ``single_state``) and ``arguments`` (default value ``marking``) attributes of the ``marking_store`` option are optional. If omitted, their default values will be used. + +.. note:: + Please note that if you decide to store $currentPlace using Doctrine, + the attribute must be mapped to an array. + With this workflow named ``blog_publishing``, you can get help to decide what actions are allowed on a blog post:: From 8bad73f94796040a987dc1132846d4ad483ce8c2 Mon Sep 17 00:00:00 2001 From: Loulier Guillaume Date: Fri, 19 Oct 2018 17:32:56 +0200 Subject: [PATCH 2/8] fix(storage): storage format Fix on the storage format (probably need to be reworded). --- workflow/usage.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/workflow/usage.rst b/workflow/usage.rst index bfbf1facf42..425e467cac0 100644 --- a/workflow/usage.rst +++ b/workflow/usage.rst @@ -158,8 +158,12 @@ like this: .. note:: - Please note that if you decide to store $currentPlace using Doctrine, - the attribute must be mapped to an array. + If a ``multiple_state`` is used, the persisted state type should be an ``array``, + using Doctrine, you can use ``json`` or ``json_array``. + + If a ``single_state`` is used, the persisted state type could be a string + + If something else is used, you're in charge of choosing the best storage format. With this workflow named ``blog_publishing``, you can get help to decide what actions are allowed on a blog post:: From 41f5ea389fb615c55cf196552327f320a8b75073 Mon Sep 17 00:00:00 2001 From: Loulier Guillaume Date: Mon, 24 Dec 2018 09:49:22 +0100 Subject: [PATCH 3/8] improvement(DB storage): improvement on type stored An improvement has been made in order to explain the usage of an int via MarkingStoreInterface --- workflow/usage.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/workflow/usage.rst b/workflow/usage.rst index 425e467cac0..31df2e80f59 100644 --- a/workflow/usage.rst +++ b/workflow/usage.rst @@ -161,7 +161,10 @@ like this: If a ``multiple_state`` is used, the persisted state type should be an ``array``, using Doctrine, you can use ``json`` or ``json_array``. - If a ``single_state`` is used, the persisted state type could be a string + If a ``single_state`` is used, the persisted state type could be a string, + if you need to store an int (due to DB limitations and/or project constraints), + be aware that you need to implement :class:`Symfony\\Component\\Workflow\\MarkingStore\\MarkingStoreInterface` + in order to transform the int back to something understandable by Workflow. If something else is used, you're in charge of choosing the best storage format. From 63a7df42b0965ebc14e3468e153220d5cb8c5ea8 Mon Sep 17 00:00:00 2001 From: Loulier Guillaume Date: Wed, 2 Jan 2019 18:16:19 +0100 Subject: [PATCH 4/8] fix(type): fix on both class and Doctrine type --- workflow/usage.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/workflow/usage.rst b/workflow/usage.rst index 31df2e80f59..ed6c83ff580 100644 --- a/workflow/usage.rst +++ b/workflow/usage.rst @@ -158,10 +158,10 @@ like this: .. note:: - If a ``multiple_state`` is used, the persisted state type should be an ``array``, - using Doctrine, you can use ``json`` or ``json_array``. + If a ``multiple_state`` is used, the attribute should be an ``array``, + using Doctrine, you can use ``json``. - If a ``single_state`` is used, the persisted state type could be a string, + If a ``single_state`` is used, the persisted state type should be a string, if you need to store an int (due to DB limitations and/or project constraints), be aware that you need to implement :class:`Symfony\\Component\\Workflow\\MarkingStore\\MarkingStoreInterface` in order to transform the int back to something understandable by Workflow. From 664b5e3a08494b691e491f40f77e9c0042735582 Mon Sep 17 00:00:00 2001 From: Loulier Guillaume Date: Wed, 2 Jan 2019 18:18:02 +0100 Subject: [PATCH 5/8] fix(store): fix on store usage --- workflow/usage.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/usage.rst b/workflow/usage.rst index ed6c83ff580..d753cdf123e 100644 --- a/workflow/usage.rst +++ b/workflow/usage.rst @@ -138,7 +138,7 @@ like this: class BlogPost { - // This property is used by the marking store, by default, Symfony "mark" this attribute as an array. + // This property is used by the marking store, by default, Symfony set the marking store as an array. public $currentPlace; public $title; public $content; From d1c0dd0d748817948c362420c206247b452dcf58 Mon Sep 17 00:00:00 2001 From: Loulier Guillaume Date: Wed, 2 Jan 2019 18:18:53 +0100 Subject: [PATCH 6/8] fix(marking): fix on marking sentence --- workflow/usage.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/usage.rst b/workflow/usage.rst index d753cdf123e..480debd23c5 100644 --- a/workflow/usage.rst +++ b/workflow/usage.rst @@ -138,7 +138,7 @@ like this: class BlogPost { - // This property is used by the marking store, by default, Symfony set the marking store as an array. + // This property is used by the marking store, by default, Symfony set the marking as an array. public $currentPlace; public $title; public $content; From b9e3c0ef9c8f9c807f3a7523abeb1738def06cd4 Mon Sep 17 00:00:00 2001 From: Loulier Guillaume Date: Thu, 9 May 2019 17:18:16 +0200 Subject: [PATCH 7/8] [FEAT] wording Co-Authored-By: Mathieu Santostefano --- workflow/usage.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workflow/usage.rst b/workflow/usage.rst index 480debd23c5..f475b872cc0 100644 --- a/workflow/usage.rst +++ b/workflow/usage.rst @@ -138,7 +138,7 @@ like this: class BlogPost { - // This property is used by the marking store, by default, Symfony set the marking as an array. + // This property is used by the marking store. If the current object is managed by a state machine, this property is a string, else if it's managed by a workflow it's an array. public $currentPlace; public $title; public $content; From 93afa792792159627384d2409b662470f362afc6 Mon Sep 17 00:00:00 2001 From: Loulier Guillaume Date: Thu, 9 May 2019 18:42:44 +0200 Subject: [PATCH 8/8] fix(wording): fix on multiple phrases --- workflow/usage.rst | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/workflow/usage.rst b/workflow/usage.rst index f475b872cc0..bf35abbbfad 100644 --- a/workflow/usage.rst +++ b/workflow/usage.rst @@ -138,18 +138,11 @@ like this: class BlogPost { - // This property is used by the marking store. If the current object is managed by a state machine, this property is a string, else if it's managed by a workflow it's an array. public $currentPlace; public $title; public $content; } -.. note:: - - The marking store type could be "multiple_state" or "single_state". - A single state marking store does not support a model being on multiple places - at the same time. - .. tip:: The ``type`` (default value ``single_state``) and ``arguments`` (default value ``marking``) @@ -158,6 +151,10 @@ like this: .. note:: + The marking store type could be "multiple_state" or "single_state". + A single state marking store does not support a model being on multiple places + at the same time. + If a ``multiple_state`` is used, the attribute should be an ``array``, using Doctrine, you can use ``json``.