Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[4.3] Update workflow config#12146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
wouterj merged 6 commits into4.3fromnoniagriconomie-feature-workflow-config
Aug 12, 2019
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletioncomponents/workflow.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -79,10 +79,11 @@ Usage
-----

When you have configured a ``Registry`` with your workflows,
you canretrieve a workflow from it and use it as follows::
you canretreive a workflow from it and use it as follows::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It looks likeretrieve is the right orthography.

OskarStark reacted with thumbs up emoji

// ...
// Consider that $blogPost is in place "draft" by default
// Consider that $post is in state "draft" by default
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The variable$post doesn't exist.

OskarStark reacted with thumbs up emoji
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

yes i updated it in another PR, and on the original one i added this line
which then create a fail merge :/

$blogPost = new BlogPost();
$workflow = $registry->get($blogPost);

Expand Down
23 changes: 16 additions & 7 deletionsreference/configuration/framework.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -255,8 +255,9 @@ Configuration
* :ref:`name <reference-workflows-name>`

* `audit_trail`_
* `initial_place`_
* `initial_marking`_
* `marking_store`_
* `metadata`_
* `places`_
* `supports`_
* `support_strategy`_
Expand DownExpand Up@@ -2736,12 +2737,12 @@ audit_trail
If set to ``true``, the :class:`Symfony\\Component\\Workflow\\EventListener\\AuditTrailListener`
will be enabled.

initial_place
"""""""""""""
initial_marking
"""""""""""""""

**type**: ``string``**default**: ``null``
**type**: ``string``| ``array``

One of the ``places`` or ``null``. If not null and the supported object is not
One of the ``places`` or ``empty``. If not null and the supported object is not
already initialized via the workflow, this place will be set.

marking_store
Expand All@@ -2753,8 +2754,16 @@ Each marking store can define any of these options:

* ``arguments`` (**type**: ``array``)
* ``service`` (**type**: ``string``)
* ``type`` (**type**: ``string`` **possible values**: ``'multiple_state'`` or
``'single_state'``)
* ``type`` (**type**: ``string`` **allow value**: ``'method'``)

metadata
""""""""

**type**: ``array``

Metadata available for the workflow configuration.
Note that ``places`` and ``transitions`` can also have their own
``metadata`` entry.

places
""""""
Expand Down
39 changes: 11 additions & 28 deletionsworkflow.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -54,12 +54,12 @@ like this:
audit_trail:
enabled: true
marking_store:
type: 'multiple_state' # or 'single_state'
arguments:
type: 'method'
property:
- 'currentPlace'
supports:
- App\Entity\BlogPost
initial_place: draft
initial_marking: draft
places:
- draft
- reviewed
Expand DownExpand Up@@ -90,35 +90,28 @@ like this:
<framework:config>
<framework:workflow name="blog_publishing" type="workflow">
<framework:audit-trail enabled="true"/>

<framework:marking-store type="single_state">
<framework:argument>currentPlace</framework:argument>
</framework:marking-store>

<framework:support>App\Entity\BlogPost</framework:support>

<framework:initial-marking>draft</framework:initial-marking>
<framework:place>draft</framework:place>
<framework:place>reviewed</framework:place>
<framework:place>rejected</framework:place>
<framework:place>published</framework:place>

<framework:transition name="to_review">
<framework:from>draft</framework:from>
<framework:to>reviewed</framework:to>
</framework:transition>

<framework:transition name="publish">
<framework:from>reviewed</framework:from>
<framework:to>published</framework:to>
</framework:transition>

<framework:transition name="reject">
<framework:from>reviewed</framework:from>
<framework:to>rejected</framework:to>
</framework:transition>

</framework:workflow>

</framework:config>
</container>

Expand All@@ -134,10 +127,11 @@ like this:
'enabled' => true
],
'marking_store' => [
'type' => 'multiple_state', // or 'single_state'
'arguments' => ['currentPlace']
'type' => 'method'
'property' => ['currentPlace']
],
'supports' => ['App\Entity\BlogPost'],
'initial_marking' => 'draft',
'places' => [
'draft',
'reviewed',
Expand DownExpand Up@@ -177,18 +171,6 @@ As configured, the following property is used by the marking store::
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``) attributes of the ``marking_store`` option are optional.
If omitted, their default values will be used.

.. tip::

Setting the ``audit_trail.enabled`` option to ``true`` makes the application
Expand All@@ -200,7 +182,7 @@ what actions are allowed on a blog post::
use App\Entity\BlogPost;
use Symfony\Component\Workflow\Exception\LogicException;

$post = BlogPost();
$post =newBlogPost();

$workflow = $this->container->get('workflow.blog_publishing');
$workflow->can($post, 'publish'); // False
Expand DownExpand Up@@ -630,8 +612,8 @@ requires:
<framework:from>reviewed</framework:from>
<framework:to>published</framework:to>
<framework:metadata>
<framework:hour_limit>20</framework:priority>
<framework:explanation>You can not publish after 8 PM.</framework:priority>
<framework:hour_limit>20</framework:hour_limit>
<framework:explanation>You can not publish after 8 PM.</framework:explanation>
</framework:metadata>
</framework:transition>
</framework:workflow>
Expand DownExpand Up@@ -682,6 +664,7 @@ Then you can access this metadata in your controller as follows::

use App\Entity\BlogPost;
use Symfony\Component\Workflow\Registry;
use App\Entity\BlogPost;

public function myController(Registry $registry, BlogPost $post)
{
Expand Down
106 changes: 53 additions & 53 deletionsworkflow/dumping-workflows.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -228,63 +228,63 @@ Below is the configuration for the pull request state machine with styling added
// ...
'workflows' => [
'pull_request' => [
'type' => 'state_machine',
'supports' => ['App\Entity\PullRequest'],
'places' => [
'start',
'coding',
'test',
'review' => [
'metadata' => [
'description' => 'Human review',
'type' => 'state_machine',
'supports' => ['App\Entity\PullRequest'],
'places' => [
'start',
'coding',
'test',
'review' => [
'metadata' => [
'description' => 'Human review',
],
],
],
'merged',
'closed' => [
'metadata' =>[
'bg_color' => 'DeepSkyBlue',
'merged',
'closed' => [
'metadata' => [
'bg_color' =>'DeepSkyBlue',
],
],
],
],
'transitions'=> [
'submit'=>[
'from' => 'start',
'to' => 'test',
],
'update'=> [
'from' =>['coding', 'test', 'review'],
'to' =>'test',
'metadata' =>[
'arrow_color' => 'Turquoise',
],
],
'wait_for_review'=>[
'from' => 'test',
'to' =>'review',
'metadata' =>[
'color' => 'Orange',
],
],
'request_change'=>[
'from' => 'review',
'to' => 'coding',
],
'accept'=>[
'from' => 'review',
'to' =>'merged',
'metadata' =>[
'label' => 'Accept PR',
],
],
'reject'=>[
'from' => 'review',
'to' => 'closed',
],
'reopen'=>[
'from' => 'start',
'to' => 'review',
'transitions' => [
'submit'=> [
'from'=>'start',
'to' => 'test',
],
'update'=> [
'from'=> ['coding', 'test', 'review'],
'to' =>'test',
'metadata' =>[
'arrow_color' =>'Turquoise',
],
],
'wait_for_review'=> [
'from'=>'test',
'to' => 'review',
'metadata' =>[
'color' =>'Orange',
],
],
'request_change'=> [
'from'=>'review',
'to' => 'coding',
],
'accept'=> [
'from'=>'review',
'to' => 'merged',
'metadata' =>[
'label' =>'Accept PR',
],
],
'reject'=> [
'from'=>'review',
'to' => 'closed',
],
'reopen'=> [
'from'=>'start',
'to' => 'review',
],
],
],
],
],
]);
Expand Down
78 changes: 39 additions & 39 deletionsworkflow/introduction.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -79,7 +79,7 @@ Below is the configuration for the pull request state machine.
type: 'state_machine'
supports:
- App\Entity\PullRequest
initial_place: start
initial_marking: start
places:
- start
- coding
Expand DownExpand Up@@ -190,46 +190,46 @@ Below is the configuration for the pull request state machine.
// ...
'workflows' => [
'pull_request' => [
'type' => 'state_machine',
'supports' => ['App\Entity\PullRequest'],
'places' => [
'start',
'coding',
'test',
'review',
'merged',
'closed',
],
'transitions' => [
'submit'=> [
'from' => 'start',
'to' => 'test',
'type' => 'state_machine',
'supports' => ['App\Entity\PullRequest'],
'places' => [
'start',
'coding',
'test',
'review',
'merged',
'closed',
],
'update'=> [
'from' => ['coding', 'test', 'review'],
'to' => 'test',
'transitions' => [
'submit'=> [
'from' => 'start',
'to' => 'test',
],
'update'=> [
'from' => ['coding', 'test', 'review'],
'to' => 'test',
],
'wait_for_review'=> [
'from' => 'test',
'to' => 'review',
],
'request_change'=> [
'from' => 'review',
'to' => 'coding',
],
'accept'=> [
'from' => 'review',
'to' => 'merged',
],
'reject'=> [
'from' => 'review',
'to' => 'closed',
],
'reopen'=> [
'from' => 'start',
'to' => 'review',
],
],
'wait_for_review'=> [
'from' => 'test',
'to' => 'review',
],
'request_change'=> [
'from' => 'review',
'to' => 'coding',
],
'accept'=> [
'from' => 'review',
'to' => 'merged',
],
'reject'=> [
'from' => 'review',
'to' => 'closed',
],
'reopen'=> [
'from' => 'start',
'to' => 'review',
],
],
],
],
]);
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp