1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2024-11-14 21:57:17 +00:00

Add notice on YamlFSM jinja2 support

This commit is contained in:
Kristóf Tóth 2018-07-27 13:59:34 +02:00
parent 8b47b301e4
commit db551e8788

View File

@ -207,7 +207,7 @@ A good state machine is the backbone of a good TFW challenge.
There are two ways to define a state machine:
- Using a YAML configuration file
- Implementing it in Python by hand
- Implementing it in Python
The first option allows you to handle FSM callbacks and custom logic in any programming language (not just Python) and is generally really easy to work with (you can execute arbitrary shell commands on events).
You should choose this method unless you have good reason not to.
@ -230,6 +230,8 @@ It is also possible to add preconditions to transitions.
This is done by adding a `predicates` key with a list of shell commands to run.
If you do this, the transition will only succeed if the return code of all predicates was `0` (as per unix convention for success).
Our `YamlFSM` implementation also supports jinja2 templates inside the `YAML` config file (examples in `test_fsm.yml`).
## Baby steps
When creating your own challenge the process should be the following: