diff --git a/config/packages/flysystem.yaml b/config/packages/flysystem.yaml index 9fd5b33..6a57dde 100644 --- a/config/packages/flysystem.yaml +++ b/config/packages/flysystem.yaml @@ -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: diff --git a/config/packages/process/demo.doctrine.database.read_paginate.yaml b/config/packages/process/demo.doctrine.database.read_paginate.yaml new file mode 100644 index 0000000..0155956 --- /dev/null +++ b/config/packages/process/demo.doctrine.database.read_paginate.yaml @@ -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' diff --git a/config/packages/process/demo.flysystem.fetch_write_failure.yaml b/config/packages/process/demo.flysystem.fetch_write_failure.yaml new file mode 100644 index 0000000..5345769 --- /dev/null +++ b/config/packages/process/demo.flysystem.fetch_write_failure.yaml @@ -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' diff --git a/config/packages/process/demo.soap.call_failure.yaml b/config/packages/process/demo.soap.call_failure.yaml new file mode 100644 index 0000000..714437b --- /dev/null +++ b/config/packages/process/demo.soap.call_failure.yaml @@ -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' diff --git a/config/services.yaml b/config/services.yaml index dcdd6f3..b02eaf1 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -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