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

feature: grouping rules into flows #40

Closed
andersonba opened this issue Nov 9, 2017 · 2 comments
Closed

feature: grouping rules into flows #40

andersonba opened this issue Nov 9, 2017 · 2 comments

Comments

@andersonba
Copy link
Owner

Group rules using flow concept.
The flow is not mandatory for rule specification.
It's just an optional feature to organize the bot conversations and prepare for next feature: Add new rules at runtime.

Defining a flow

- flow: flow_name
  rules:
    - List of rules
    - message: ...

# or

- message: List of rules
  flow: flow_name

- message: ...
  flow: flow_name

Jumping between flows

- flow: identification
  rules:
    - Welcome!
    - message: Your name?
      name: name
      type: String
    - message: Thanks!
      next: question.help
    - Skip

- flow: question
  rules:
    - message: Can I help you?
      name: help

# bot> Welcome!
# bot> Your name?
# usr> Anderson
# bot> Thanks
# bot> Can I help you?

Jumping inside flow

Keeping currently behavior

- flow: default
  rules:
    - message: Welcome
      next: end
    - message: Skip
    - message: End
      name: end
      exit: true

- flow: another
  rules:
    - Skip 2
    - message: Skip 3
      name: end

# bot> Welcome
# bot> End
@andersonba
Copy link
Owner Author

@rafaelverger
Copy link
Contributor

👏 👏 👏 👏

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

2 participants