Skip to content

Commit 140d810

Browse files
committed
Started to write the documentation about actions
1 parent 673692e commit 140d810

File tree

3 files changed

+151
-0
lines changed

3 files changed

+151
-0
lines changed

config.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ hasChildren = true
6868
url = "core-concept/workflow"
6969
weight = 3
7070

71+
[[menu.main]]
72+
parent = "Core concepts"
73+
name = "Action"
74+
url = "core-concept/action"
75+
weight = 4
76+
7177
[[menu.main]]
7278
weight = 3
7379
name = "Features"
@@ -180,6 +186,17 @@ hasChildren = true
180186
url = "connectivity/filtering"
181187
weight = 12
182188

189+
[[menu.main]]
190+
name = "Actions"
191+
weight = 4
192+
hasChildren = true
193+
194+
[[menu.main]]
195+
parent = "Actions"
196+
name = "Custom"
197+
url = "action/custom"
198+
weight = 1
199+
183200
[params]
184201
logo = "logo-web.svg"
185202
logo_white = "logo-web.svg"

content/action/custom/index.en.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
title: "Custom"
3+
date: 2023-07-06T15:54:13+02:00
4+
draft: false
5+
weight: 1
6+
---
7+
8+
- [What is it ?](#what-is-it-)
9+
- [Installation](#installation)
10+
- [Usage](#usage)
11+
- [Building an extractor](#building-an-extractor)
12+
- [Building a transformer](#building-a-transformer)
13+
- [Building a loader](#building-a-loader)
14+
---
15+
16+
## Definition
17+
18+
The custom connector allows you to use your own source code in your [actions](https://php-etl.github.io/documentation/core-concept/action/),
19+
allowing you to connect tools that are not supported by the standard distribution.
20+
21+
## Installation
22+
23+
This feature is already integrated into the Satellite package, so you can’t require it with the composer.
24+
25+
## Usage
26+
27+
First you need to [determine your services](../../feature/services) in your pipeline or workflow and then use the `use`
28+
option which allows you to define which service to use.
29+
30+
```yaml
31+
32+
```
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
---
2+
title: "Action"
3+
date: 2023-07-06T15:06:20+02:00
4+
draft: false
5+
weight: 4
6+
---
7+
8+
{{< feature-state for_mw_version="0.1" state="alpha" >}}
9+
10+
- [What is it for?](#what-is-it-for)
11+
- [Installation](#installation)
12+
- [Basic Usage](#basic-usage)
13+
- [Advanced Usage](#advanced-usage)
14+
- [Using expressions](#using-expressions)
15+
- [Adding logger](#adding-logger)
16+
- [Adding state](#adding-state)
17+
18+
---
19+
20+
> An action is a process that enables a task to be carried out before, during or at the end of the execution of a workflow.
21+
22+
## What is it for?
23+
24+
This package provides a process capable of executing actions.
25+
26+
## Installation
27+
28+
```shell
29+
composer require php-etl/action
30+
```
31+
32+
## Basic usage
33+
34+
At present, actions can only be used within a workflow. It is therefore not currently possible to launch an action on its own.
35+
36+
```yaml
37+
workflow:
38+
jobs:
39+
- action: # ...
40+
- pipeline: # ...
41+
- action: # ...
42+
```
43+
44+
## Advanced usage
45+
46+
### Using expressions
47+
48+
It's possible to use expressions in your pipeline using the `expression_language` option. To use these expressions,
49+
you need to use our customised Providers which provide the different expressions. For more information, please visit
50+
the [detailed documentation](../../feature/expression-language) of the language expressions.
51+
52+
```yaml
53+
action:
54+
expression_language:
55+
- 'Kiboko\Component\Satellite\ExpressionLanguage\Provider'
56+
```
57+
58+
### Adding logger
59+
60+
It's possible to add a `logger` at each action of a workflow.
61+
62+
For more details, go to the [detailed logger documentation](../../feature/logger).
63+
64+
```yaml
65+
satellite:
66+
# ...
67+
workflow:
68+
jobs:
69+
- action:
70+
# ...
71+
logger:
72+
channel: pipeline
73+
destinations:
74+
- elasticsearch:
75+
level: warning
76+
hosts:
77+
- http://user:password@elasticsearch.example.com:9200
78+
```
79+
80+
### Adding state
81+
82+
It's possible to add a `state` at each action of a workflow.
83+
84+
For more details, go to the [detailed state documentation](../../feature/state)
85+
86+
```yaml
87+
satellite:
88+
# ...
89+
workflow:
90+
jobs:
91+
- action:
92+
# ...
93+
state:
94+
destinations:
95+
- rabbitmq:
96+
host: rabbitmq.example.com
97+
vhost: /
98+
topic: foo.rejects
99+
```
100+
101+
> As you can see, actions are only able to manage the logs and states of their processes,
102+
> but cannot deal with rejects that are contrary to pipelines.

0 commit comments

Comments
 (0)