Let's say that your capsule has a requirement to allow the end-user to select from a set of fixed values. Here is a snippet code that will allow you to model this behavior.
We are going to represent the fixed values as an enum
enum (FixedValue) {
symbol (ONE)
symbol (TWO)
symbol (THREE)
symbol (FOUR)
}
The Action file will look like this
action (GetFixedValue) {
type(Search)
description (Allow user to choose a value from the set of fixed values)
collect{
input (fixedValue) {
type (FixedValue)
min (Required) max (One)
prompt-behavior (AlwaysElicitation)
default-init {
intent {
goal: FixedValue
value-set {FixedValue {FixedValue(ONE) FixedValue(TWO) FixedValue(THREE) FixedValue(FOUR) }}
}
}
}
} output (FixedValue)
}
The Javascript file for this action is as follows:
module.exports.function = function GetFixedValue (fixedValue) {
return JSON.stringify(fixedValue)
}
Comments
0 comments
Please sign in to leave a comment.