Skip to content

Commit 4a6ac34

Browse files
committed
changed data sample in the README
1 parent 7f92fd1 commit 4a6ac34

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,29 @@ It emits a message with an object equivalent to the JSON in the config. So any d
1010
## Credentials
1111
Configuration data should be specified as credentials of a JSON format.
1212
JSON must be valid in order for credentials to be verified (except arrays, see *Known limitations* below). Credentials verification will fail otherwise.
13-
Input data example:
14-
![Data sample](https://user-images.githubusercontent.com/8449044/48360400-d3138980-e6a7-11e8-8b79-87932eec66c1.png)
13+
14+
Input data example. Consider the following example:
15+
16+
* Someone wants to synchronize prices between an ERP and an E-SHOP
17+
* The price logic is so complex that it can not pragmatically exist in a single flow.
18+
* Prices in the ERP exist in only in currency A. Prices in the E-SHOP are in currency B. The customer wants to convert prices as data is moved between systems at a fixed rate that they set.
19+
* This fixed rate must be the same between all flows.
20+
21+
If the config component existed, you build flows of the following form:
22+
ERP.GetPriceInfo() -> Config.LoadConfig() -> E-SHOP.SetPrice(price := ERPResults.Price * ConfigResults.ExchangeRate)
23+
If one needed to change the exchange rate, that value could be edited by modifying the config credentials to include the new rate and then resetting the snapshot for all the price import flows.
24+
Currency rates sample:
25+
```json
26+
{
27+
"USDEUR": 0.881715,
28+
"USDFJD": 2.115102,
29+
"USDPLN": 3.787097,
30+
"USDQAR": 3.641042,
31+
"USDUAH": 30.718014,
32+
"USDZWL": 322.355011
33+
}
34+
```
35+
Then the currency rate can be used in any number of flows, where it is needed and then changed form the single place. That changes will affect all the flows where it is used.
1536
## Actions
1637
### Emit data
1738
The only action. Emits configuration data (must be a valid JSON object) as a message.

0 commit comments

Comments
 (0)