Skip to content

Commit 44a680c

Browse files
vidarladriendupuisdabrt
committed
Workflows: Document how to set which user group can review (#2483)
--------- Co-authored-by: Adrien Dupuis <[email protected]> Co-authored-by: Tomasz Dąbrowski <[email protected]>
1 parent 857ab0d commit 44a680c

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

code_samples/workflow/custom_workflow/config/packages/workflows.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ ezplatform:
3030
icon: '/bundles/ibexaplatformicons/img/all-icons.svg#notice'
3131
reviewers:
3232
required: true
33+
user_group: 13
3334
actions:
3435
legal_transition_action:
3536
data:

docs/guide/workflow/add_custom_workflow_action.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ The following example shows how to configure two custom actions that send custom
1616

1717
Configure the first custom action in the following way:
1818

19-
``` yaml hl_lines="15-18"
20-
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 0, 5) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 23, 36) =]]
19+
``` yaml hl_lines="16-19"
20+
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 0, 5) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 23, 37) =]]
2121
```
2222

2323
The configuration indicates the name of the custom action (`legal_transition_action`).
@@ -27,7 +27,7 @@ The configuration indicates the name of the custom action (`legal_transition_act
2727

2828
To define what the action does, create an event listener `src/EventListener/LegalTransitionListener.php`:
2929

30-
``` php hl_lines="27 36"
30+
``` php hl_lines="27 37"
3131
[[= include_file('code_samples/workflow/custom_workflow/src/EventListener/LegalTransitionListener.php') =]]
3232
```
3333

@@ -48,7 +48,7 @@ Line 36 in the listener above sets a custom result value for the transition.
4848
You can use this value in other stages and transitions for this Content item, for example:
4949

5050
``` yaml hl_lines="10 11"
51-
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 42, 53) =]]
51+
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 43, 54) =]]
5252
```
5353

5454
The action indicated here is performed only if the result from the `legal_transition_action` is set to `true`.

docs/guide/workflow/workflow.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The following example configuration defines a workflow where you can optionally
2222
![Diagram of custom workflow](../img/workflow_custom_diagram.png)
2323

2424
``` yaml
25-
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 0, 32) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 37, 50) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 53, 61) =]]
25+
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 0, 33) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 38, 51) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 54, 62) =]]
2626
```
2727

2828
### Matchers
@@ -57,13 +57,14 @@ A transition must state between which stages it transitions (lines 3-4),
5757
or be `reverse` to a different transition (line 9).
5858

5959
``` yaml hl_lines="3 4 9"
60-
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 23, 30) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 37, 42) =]]
60+
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 23, 30) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 38, 43) =]]
6161
```
6262

6363
### Reviewers
6464

6565
When moving a Content item through a transition, the user can select a reviewer.
6666
Assigning a reviewer is mandatory if you set `reviewers.required` to `true` for this transition.
67+
You can restrict who can review the content item by setting `reviewers.user_group` to a Location ID of the user group.
6768

6869
To be able to search for users for review, the user must have the content/read Policy without any Limitation,
6970
or with a Limitation that allows reading users.
@@ -103,7 +104,7 @@ You can automatically publish a Content item once it goes through a specific tra
103104
To do so, configure the `publish` action for the transition:
104105

105106
``` yaml hl_lines="7 8"
106-
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 53, 61) =]]
107+
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 54, 62) =]]
107108
```
108109

109110
### Disable Quick Review
@@ -112,7 +113,7 @@ You can disable the default workflow, for example, if your project does not use
112113
workflows, or Quick Review entries clog your database:
113114

114115
``` yaml
115-
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 0, 4) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 62, 66) =]]
116+
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 0, 4) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 63, 67) =]]
116117
```
117118

118119
## Custom actions
@@ -193,8 +194,8 @@ To enable form validation in UI before sending it to the next stage of the workf
193194
add `validate: true` to the transitions of the stage.
194195
In the example below the form is validated in two stages:` to_legal` and `done`:
195196

196-
``` yaml hl_lines="14 27"
197-
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 23, 42) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 54, 62) =]]
197+
``` yaml hl_lines="15 28"
198+
[[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 23, 43) =]][[= include_file('code_samples/workflow/custom_workflow/config/packages/workflows.yaml', 55, 63) =]]
198199
```
199200

200201
You can check validation for a particular stage of the workflow even if the stage doesn't have any actions.

0 commit comments

Comments
 (0)