Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
5 changes: 5 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,8 @@ WIREMOCK_URL=http://wiremock:8080
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
DEFAULT_URI=http://process-bundle-demo.localhost
###< symfony/routing ###

###> symfony/fake-chat-notifier ###
# Notifications of the process executions written in the logs (cleverage/ui-process-bundle#62)
FAKE_CHAT_DSN=fakechat+logger://default
###< symfony/fake-chat-notifier ###
2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
"league/flysystem-sftp-v3": "^3.0",
"symfony/cache": "^6.4 || ^7.4 || ^8",
"symfony/cache-contracts": "^3",
"symfony/fake-chat-notifier": "^6.4 || ^7.4 || ^8",
"symfony/flex": "^v2.3",
"symfony/framework-bundle": "^6.4 || ^7.4 || ^8",
"symfony/http-kernel": "^6.4 || ^7.4 || ^8",
"symfony/notifier": "^6.4 || ^7.4 || ^8",
"symfony/password-hasher": "^6.4 || ^7.4 || ^8",
"symfony/scheduler": "^6.4 || ^7.4 || ^8"
},
Expand Down
10 changes: 10 additions & 0 deletions config/packages/notifier.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
framework:
notifier:
chatter_transports:
# Notifications written in the logs ("notifier" channel), see the demo.ui.notification* processes
fakechat: '%env(FAKE_CHAT_DSN)%'
channel_policy:
urgent: ['chat/fakechat']
high: ['chat/fakechat']
medium: ['chat/fakechat']
low: ['chat/fakechat']
27 changes: 27 additions & 0 deletions config/packages/process/demo.ui.notification.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
clever_age_process:
configurations:
demo.ui.notification:
description: >
Notification of the end of a process execution (cleverage/ui-process-bundle#62): the process logs a
warning, so it finishes with a report ({"Warning": 1}) and the "finish_with_report" status is notified.
The notification is enabled by the process options (it is disabled by default) and sent with the
fakechat transport, which writes it in the logs ("notifier" channel).
help: >
Ex: bin/console cleverage:process:execute demo.ui.notification -vv
options:
ui:
source: Foo
target: Bar
notification:
enabled: true
tasks:
entry:
service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask'
options:
output: 'data'
outputs: [log]
log:
service: '@CleverAge\ProcessBundle\Task\Reporting\LoggerTask'
options:
message: Warning counted in the report of the process execution
level: warning
19 changes: 19 additions & 0 deletions config/packages/process/demo.ui.notification_failing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
clever_age_process:
configurations:
demo.ui.notification_failing:
description: >
Notification of a failed process execution (cleverage/ui-process-bundle#62): the ConstantOutputTask
misses its required "output" option, the process fails and the "failed" status is notified, with the
error. The notification is enabled by the process options (it is disabled by default) and sent with
the fakechat transport, which writes it in the logs ("notifier" channel).
help: >
Ex: bin/console cleverage:process:execute demo.ui.notification_failing -vv
options:
ui:
source: Foo
target: Bar
notification:
enabled: true
tasks:
entry:
service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask'
21 changes: 21 additions & 0 deletions symfony.lock
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,15 @@
"config/packages/debug.yaml"
]
},
"symfony/fake-chat-notifier": {
"version": "7.4",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "5.3",
"ref": "25bdcc3ae00d284b863f1faecf14610aecebfeb5"
}
},
"symfony/flex": {
"version": "2.4",
"recipe": {
Expand Down Expand Up @@ -249,6 +258,18 @@
"config/packages/monolog.yaml"
]
},
"symfony/notifier": {
"version": "7.4",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "5.0",
"ref": "178877daf79d2dbd62129dd03612cb1a2cb407cc"
},
"files": [
"config/packages/notifier.yaml"
]
},
"symfony/property-info": {
"version": "7.3",
"recipe": {
Expand Down
Loading