Improve documentation on Choose action #1312
Unanswered
SimonGAndrews
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I struggled to implement the chose action functions. I couldnt find an example of the use of Choose Action on the Github and the description in the guides took a while with experiments to understand. Esentially tt was not initially clear to me that the a cond was one and the same as a condition defined in a guard. Guards are disucssed within the Guarded transactions section and its not obvious they are needed to suppot other functionality (eg choose action)
Suggestions:
In the choose Actions section of the guides:
Each "conditional actions" object in cond has these properties:
put a few words to make the link to guard/condition definitions
eg Conditions are named guard conditions as defined in the guard options of the machine (link) or are defined in line (link)
Include in the example in choose action the definion of the guard that defines the conditions in the example. To help see the dependency on guard/condition definition. eg
guards: {
cond1: (context, event, { cond }) => {
return ( false) // setting to true results in cond1 actions being executed
},
cond2: (context, event, { cond }) => {
return ( true)
},
}
Sorry to be picky , but this may hlep others.
Beta Was this translation helpful? Give feedback.
All reactions