Skip to content

Instantly share code, notes, and snippets.

@rockaBe
Last active April 26, 2016 11:48
Show Gist options
  • Save rockaBe/9aa626c495b43981e7a5 to your computer and use it in GitHub Desktop.
Save rockaBe/9aa626c495b43981e7a5 to your computer and use it in GitHub Desktop.
Flow definition rules

Missing elements:

  • answers to be included in the questions for flows (product_preview or registratioin) need to be defined

  • the selected answer

    • must be validated
    • needs to be remembered

Naming:

  • everything in singular OR plural but don't switch from one to the other
    e.g. "question", "condition" etc.
[
{
"type": "product_preview",
"value": "product_preview_2"
},
{
"type": "registration",
"value": "registration_1"
}
]
[
{
"type": "questions",
"value": ["age"]
},
{
"type": "condition",
"value": [
{
"question": "age",
"answer": "0-17"
}
],
"true_branch": [
{
"type": "lesson",
"value": "young"
}
],
"false_branch": [
{
"type": "questions",
"value": [ "motivation" ]
},
{
"type": "lesson",
"value": "adult"
}
]
}
]
[
{
"type": "condition",
"value": [
{
"question": "age",
"answer": "0-18"
},
],
"true_branch": [
{
"type": "questions",
"value": [
"source"
]
},
{
"type": "inputs",
"value": [
"first_name",
"email",
"password"
]
}
],
"false_branch": [
{
"type": "inputs",
"value": ["first_name"]
},
{
"type": "questions",
"value": [
"difficulty"
]
},
{
"type": "inputs",
"value": [
"email",
"password"
]
},
{
"condition": [
{
"question": "age",
"answer": "65-99"
},
{
"true_branch": [
{
"type": "redirect",
"value": "https://www.mybestthought.com"
}
]
}
]
}
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment