Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logic and Piping #11

Closed
danleecreates opened this issue Nov 28, 2016 · 4 comments
Closed

Logic and Piping #11

danleecreates opened this issue Nov 28, 2016 · 4 comments

Comments

@danleecreates
Copy link

danleecreates commented Nov 28, 2016

It would be great to build in some kind of logic response and piping.

Question 1: How do you like your eggs in the morning?
A - Fried Sunny Side Up
B - Poached
C - Scrambled

Question 2: Are you
A: Male
B: Female?

if (question 1:A AND 2:A Answered ) {
 "Sir, you eat the breakfast of champions!"
else if (question 1:A AND 2:B Answered ) {
 "Madam, you eat the breakfast of champions!"
} else if (question 1:A Answered) { 
You eat the breakfast of champions!"
}
@felixknox
Copy link
Contributor

hi @nearkingdom please see my answer here; 1. "100% control", would that work?
A 3rd solution could also be more in the lines of what you have written as the example code. Where defining a if, else mapping to the existing tags and passing that as an argument when creating the ConversationalForm instance. A tool that would allow you to select the tags and do the mapping visually, outputting the code structure below could be interesting to explore.

if (question 1:A AND 2:A Answered ) {
 #id-to-element-A-A -> show
else if (question 1:A AND 2:B Answered ) {
 #id-to-element-B-B -> show
} else if (question 1:A Answered) { 
#id-to-element-A -> show
}

@danleecreates
Copy link
Author

I like the idea of mapping the logic visually.

@felixknox felixknox added this to the 1.0.0 milestone Dec 8, 2016
@g3offrey
Copy link

g3offrey commented Dec 16, 2016

If you want, I made a PR (#42) which fix this "issue". Don't hesitate to check it and post your feedback 😄

@felixknox
Copy link
Contributor

felixknox commented May 16, 2017

Please see latest release with Conditional Flow and example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants