Skip to content

Flow problems in Colang 1 and 2 #755

@geraldhahn

Description

@geraldhahn

Hi,

I have been playing around with the Colang flow control in version 1 and 2. I do not get it to work the way I hoped.

First I tried the Colang 1 example from the documentation:

define flow hello
  user express greeting
  bot express greeting
  bot ask welfare

  when user express happiness
    bot express happiness
  else when user express sadness
    bot express empathy

(I left the definition of what the user and bot say out for clarity)

When I express a greeting, the bot, as expected from the flow definition, also responds with a greeting. However, when I want to continue the flow by expressing happiness, I just get a generic answer that does not match what was defined in the 'bot express happiness' definition. Only when I define a separate flow outside the flow hello, where a user express happiness statement is followed by a bot express happiness statement, it works.

It looks as if the 'when' statements are not really taken into account and when the user expresses happiness it looks for a flow associated to it outside of the flow hello statements. It just skips the whole 'when' block.

Is there error in the syntax here or something I missed?

Then I tried the Colang 2 flow example to see if it works better:

import core

flow main
    bot say "How are you?"
    bot react to user wellbeing

flow bot react to user wellbeing
    when user said "Good" or user said "Great"
        bot say "Great"
    or when user said "Bad" or user said "Terrible"
        bot say "Sorry to hear"

When I run the code the bot would ask 'How are you?' as expected. However, When I type 'Good' or 'Bad', the only response I get is 'How are you' again and again without following the flow defined in 'react to user wellbeing' at all.

Is there something I missed ? Do I need to add more code?

Thanks for your help !

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions