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
7 changes: 7 additions & 0 deletions config/packages/flysystem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ flysystem:
options:
directory: '%local.storage.dir%'

# Local storage whose target path is a directory: writing a file there fails.
# Used by demo.flysystem.fetch_write_failure (cleverage/flysystem-process-bundle#35).
local.storage.fetch_failure:
adapter: 'local'
options:
directory: '%kernel.project_dir%/var/storage/fetch_failure'

remote.storage:
adapter: 'sftp'
options:
Expand Down
35 changes: 35 additions & 0 deletions config/packages/process/demo.doctrine.database.read_paginate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
clever_age_process:
configurations:
demo.doctrine.database.read_paginate:
description: >
Read the book table by pages of 2 rows with the DatabaseReaderTask `paginate` option.
Every row must be output once (cleverage/doctrine-process-bundle#30).
help: >
Ex: bin/console cleverage:process:execute demo.doctrine.database.read_paginate
options:
ui:
source: Bar
target: Foo
tasks:
read:
service: '@CleverAge\DoctrineProcessBundle\Task\Database\DatabaseReaderTask'
options:
table: 'book'
sql: 'SELECT id FROM book ORDER BY id'
paginate: 2
outputs: [ids]

ids:
service: '@CleverAge\ProcessBundle\Task\TransformerTask'
options:
transformers:
array_map:
transformers:
property_accessor:
property_path: '[id]'
implode:
separator: ','
outputs: [debug]

debug:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'
49 changes: 49 additions & 0 deletions config/packages/process/demo.flysystem.fetch_write_failure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
clever_age_process:
configurations:
demo.flysystem.fetch_write_failure:
description: >
Copy a file with FileFetchTask (remove_source: true) to a storage where the write fails (the target
path is a directory). The task must fail and keep the source file (cleverage/flysystem-process-bundle#35).
help: >
Ex: bin/console cleverage:process:execute demo.flysystem.fetch_write_failure && ls var/storage/local
options:
ui:
source: Bar
target: Foo
tasks:
content:
service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask'
options:
output: 'Some important data'
outputs: [write_source]

write_source:
service: '@CleverAge\ProcessBundle\Task\File\FileWriterTask'
description: The file to copy, in local.storage
options:
filename: '%local.storage.dir%/demo_fetch_write_failure.txt'
outputs: [block_destination]

block_destination:
service: '@CleverAge\ProcessBundle\Task\File\FileWriterTask'
description: Creates a directory named like the file in local.storage.fetch_failure, so writing the file fails
options:
filename: '%kernel.project_dir%/var/storage/fetch_failure/demo_fetch_write_failure.txt/blocker'
outputs: [filename]

filename:
service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask'
options:
output: 'demo_fetch_write_failure.txt'
outputs: [fetch]

fetch:
service: '@CleverAge\FlysystemProcessBundle\Task\FileFetchTask'
options:
source_filesystem: 'local.storage'
destination_filesystem: 'local.storage.fetch_failure'
remove_source: true
outputs: [debug]

debug:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'
63 changes: 63 additions & 0 deletions config/packages/process/demo.soap.call_failure.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
clever_age_process:
configurations:
demo.soap.call_failure:
description: >
A failing SOAP call with the `stop` error strategy: the process must fail
(cleverage/soap-process-bundle#25).
help: >
Ex: bin/console cleverage:process:execute demo.soap.call_failure
options:
ui:
source: Bar
target: Foo
tasks:
entry:
service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask'
options:
output:
sCountryISOCode: 'FR'
outputs: [request]

request:
service: '@CleverAge\SoapProcessBundle\Task\RequestTask'
error_strategy: 'stop'
options:
client: unreachable
method: 'FullCountryInfo'
outputs: [debug]

debug:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'

demo.soap.call_failure_skip:
description: >
A failing SOAP call with the `skip` error strategy: the error branch must receive the task input
(cleverage/soap-process-bundle#25).
help: >
Ex: bin/console cleverage:process:execute demo.soap.call_failure_skip
options:
ui:
source: Bar
target: Foo
tasks:
entry:
service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask'
options:
output:
sCountryISOCode: 'FR'
outputs: [request]

request:
service: '@CleverAge\SoapProcessBundle\Task\RequestTask'
error_strategy: 'skip'
options:
client: unreachable
method: 'FullCountryInfo'
outputs: [debug]
error_outputs: [debug_error]

debug:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'

debug_error:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'
15 changes: 15 additions & 0 deletions config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ services:
tags:
- { name: cleverage.soap.client }

# Non-WSDL SOAP client pointing to a closed port: every call fails with a SoapFault.
# Used by demo.soap.call_failure (cleverage/soap-process-bundle#25).
app.cleverage_soap_process.client.unreachable:
class: CleverAge\SoapProcessBundle\Client\Client
bind:
$code: 'unreachable'
$wsdl: null
$options:
location: 'http://127.0.0.1:1/soap'
uri: 'urn:demo'
exceptions: true
connection_timeout: 2
tags:
- { name: cleverage.soap.client }

# For cleverage/rest-process-bundle
app.cleverage_rest_process.client.apicarto_ign:
class: CleverAge\RestProcessBundle\Client\Client
Expand Down
Loading