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
8 changes: 4 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
- [CsvReaderTask](reference/tasks/csv_reader_task.md)
- [CsvWriterTask](reference/tasks/csv_writer_task.md)
- [CSVSplitterTask]
- [InputCsvReaderTask]
- [InputCsvReaderTask](reference/tasks/input_csv_reader_task.md)
- File/JsonStream
- [JsonStreamReaderTask]
- File/XML
Expand Down Expand Up @@ -79,7 +79,7 @@
- [ProcessLauncherTask]
- Reporting
- [AdvancedStatCounterTask]
- [LoggerTask]
- [LoggerTask](reference/tasks/logger_task.md)
- [StatCounterTask]
- Transformers
- Basic and debug
Expand Down Expand Up @@ -120,8 +120,8 @@
- String
- [ExplodeTransformer]
- [HashTransformer]
- [ImplodeTransformer]
- [SlugifyTransformer]
- [ImplodeTransformer](reference/transformers/implode_transformer.md)
- [SlugifyTransformer](reference/transformers/slugify_transformer.md)
- [SprintfTransformer]
- [TrimTransformer](reference/transformers/trim_transformer.md)
- XML
Expand Down
24 changes: 9 additions & 15 deletions docs/reference/tasks/constant_iterable_output_task.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,12 @@ Example
-------

```yaml
clever_age_process:
configurations:
project_prefix.constant_iterable_output_example:
tasks:
constant_iterable_output_example:
service: '@CleverAge\ProcessBundle\Task\ConstantIterableOutputTask'
options:
output:
id: 123
firstname: Test1
lastname: Test2
outputs: [debug]
debug:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'
```
# Task configuration level
code:
service: '@CleverAge\ProcessBundle\Task\ConstantIterableOutputTask'
options:
output:
id: 123
firstname: Test1
lastname: Test2
```
24 changes: 9 additions & 15 deletions docs/reference/tasks/constant_output_task.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,12 @@ Example
-------

```yaml
clever_age_process:
configurations:
project_prefix.constant_output_example:
tasks:
constant_output_example:
service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask'
options:
output:
id: 123
firstname: Test1
lastname: Test2
outputs: [debug]
debug:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'
```
# Task configuration level
code:
service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask'
options:
output:
id: 123
firstname: Test1
lastname: Test2
```
31 changes: 7 additions & 24 deletions docs/reference/tasks/counter_task.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Task reference
Accepted inputs
---------------

`any`
`any`, must implement IterableTaskInterface

Possible outputs
----------------
Expand All @@ -31,26 +31,9 @@ Example
-------

```yaml
clever_age_process:
configurations:
project_prefix.counter_example:
tasks:
counter_example:
service: '@CleverAge\ProcessBundle\Task\ConstantIterableOutputTask'
options:
output:
test1: test1
test2: test2
test3: test3
test4: test4
test5: test5
test6: test6
outputs: [counter]
counter:
service: '@CleverAge\ProcessBundle\Task\CounterTask'
options:
flush_every: 2
outputs: [ debug ]
debug:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'
```
# Task configuration level
code:
service: '@CleverAge\ProcessBundle\Task\CounterTask'
options:
flush_every: 2
```
32 changes: 23 additions & 9 deletions docs/reference/tasks/csv_reader_task.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,26 @@ Underlying method is [fgetcsv](https://secure.php.net/manual/en/function.fgetcsv
Options
-------

| Code | Type | Required | Default | Description |
| ---- | ---- | :------: | ------- | ----------- |
| `file_path` | `string` | **X** | | Path of the file to read from (relative to symfony root or absolute) |
| `delimiter` | `string` | | `;` | CSV delimiter |
| `enclosure` | `string` | | `"` | CSV enclosure character |
| `escape` | `string` | | `\\` | CSV escape character |
| `headers` | `array` or `null` | | `null` | Static list of CSV headers, without the option, it will be dynamically read from first input |
| `mode` | `string` | | `rb` | File open mode (see [fopen mode parameter](https://secure.php.net/manual/en/function.fopen.php)) |
| `log_empty_lines` | `bool` | | `false` | Log when the output is empty |
| Code | Type | Required | Default | Description |
|-------------------|-------------------|:---------:|----------|--------------------------------------------------------------------------------------------------|
| `file_path` | `string` | **X** | | Path of the file to read from (relative to symfony root or absolute) |
| `delimiter` | `string` | | `;` | CSV delimiter |
| `enclosure` | `string` | | `"` | CSV enclosure character |
| `escape` | `string` | | `\\` | CSV escape character |
| `headers` | `array` or `null` | | `null` | Static list of CSV headers, without the option, it will be dynamically read from first input |
| `mode` | `string` | | `rb` | File open mode (see [fopen mode parameter](https://secure.php.net/manual/en/function.fopen.php)) |
| `log_empty_lines` | `bool` | | `false` | Log when the output is empty |

Example
-------

```yaml
# Task configuration level
code:
service: '@CleverAge\ProcessBundle\Task\File\Csv\CsvReaderTask'
options:
file_path: 'path/to/file.csv'
delimiter: '{{ delimiter }}' ## delimiter is contextualized you must add -c delimiter:";" on console execute
```


29 changes: 14 additions & 15 deletions docs/reference/tasks/debug_task.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,21 @@ Possible outputs

`any`: re-output given input

Options
-------

None

Example
----------------

```yaml
clever_age_process:
configurations:
project_prefix.debug_example:
tasks:
debug_example:
service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask'
options:
output:
id: 123
firstname: Test1
lastname: Test2
outputs: [debug]
debug:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'
```
# Task configuration level
code:
service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask'
options:
output:
id: 123
firstname: Test1
lastname: Test2
```
16 changes: 9 additions & 7 deletions docs/reference/tasks/die_task.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ Possible outputs

None

Options
-------

None

Example
----------------

```yaml
clever_age_process:
configurations:
project_prefix.die_example:
tasks:
die_example:
service: '@CleverAge\ProcessBundle\Task\Debug\DieTask'
```
# Task configuration level
code:
service: '@CleverAge\ProcessBundle\Task\Debug\DieTask'
```
50 changes: 24 additions & 26 deletions docs/reference/tasks/dummy_task.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,31 @@ Possible outputs

`any`: re-output given input

Options
-------

None

Example
-------

```yaml
clever_age_process:
configurations:
project_prefix.dummy_example:
tasks:
dummy_example:
service: '@CleverAge\ProcessBundle\Task\DummyTask'
outputs: [output1, output2]
output1:
service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask'
options:
output:
id: 123
firstname: Test1
lastname: Test2
outputs: [debug]
output2:
service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask'
options:
output:
id: 456
firstname: Test3
lastname: Test4
outputs: [ debug ]
debug:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'
```
# Task configuration level
dummy:
service: '@CleverAge\ProcessBundle\Task\DummyTask'
outputs: [output1, output2]
output1:
service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask'
options:
output:
id: 123
firstname: Test1
lastname: Test2
output2:
service: '@CleverAge\ProcessBundle\Task\ConstantOutputTask'
options:
output:
id: 456
firstname: Test3
lastname: Test4
```
25 changes: 9 additions & 16 deletions docs/reference/tasks/error_forwarder_task.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,16 @@ Possible outputs

`any`: directly error_output given `output` option

Options
-------

None

Example
-------

```yaml
clever_age_process:
configurations:
project_prefix.error_forwarder_example:
tasks:
error_forwarder_example:
service: '@CleverAge\ProcessBundle\Task\ConstantIterableOutputTask'
options:
output:
error1: Error 1
error2: Error 2
error3: Error 3
outputs: [error_forwarder]
error_forwarder:
service: '@CleverAge\ProcessBundle\Task\Debug\ErrorForwarderTask'

```
# Task configuration level
code:
service: '@CleverAge\ProcessBundle\Task\Debug\ErrorForwarderTask'
```
18 changes: 6 additions & 12 deletions docs/reference/tasks/event_dispatcher_task.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,9 @@ Example
-------

```yaml
clever_age_process:
configurations:
project_prefix.event_dispatcher_example:
tasks:
event_dispatcher_example:
service: '@CleverAge\ProcessBundle\Task\Event\EventDispatcherTask'
options:
event_name: 'myapp.myevent'
outputs: [debug]
debug:
service: '@CleverAge\ProcessBundle\Task\Debug\DebugTask'
```
# Task configuration level
code:
service: '@CleverAge\ProcessBundle\Task\Event\EventDispatcherTask'
options:
event_name: 'myapp.myevent'
```
46 changes: 46 additions & 0 deletions docs/reference/tasks/input_csv_reader_task.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
InputCsvReaderTask
=============

Reads a CSV file and iterate on each line, returning an array of key -> values. Skips empty lines.

Task reference
--------------

* **Service**: `CleverAge\ProcessBundle\Task\File\Csv\InputCsvReaderTask`
* **Iterable task**

Accepted inputs
---------------

`string`: file path

Possible outputs
----------------

`array`: foreach line, it will return a php array where key comes from headers and values are strings.
Underlying method is [fgetcsv](https://secure.php.net/manual/en/function.fgetcsv.php).

Options
-------

Same as [CsvReaderTask](reference/tasks/csv_reader_task.md) except following :

| Code | Type | Required | Default | Description |
|-------------|----------|:--------:|---------|----------------------------|
| `file_path` | | | | Removed, use input instead |
| `base_path` | `string` | | `` | |

Example
-------

```yaml
clever_age_process:
configurations:
process.name:
entry_point: entrypoint # for upload_and_run process entry_point is required
tasks:
entrypoint:
service: '@CleverAge\ProcessBundle\Task\File\Csv\InputCsvReaderTask'
options:
delimiter: '{{ delimiter }}' ## delimiter is contextualized you must add -c delimiter:";" on console execute
```
Loading
Loading