ConditionalSelector class

Select between two rule selectors based on a condition.

Extends

Properties

$kind
condition

Expression that determines which selector to use.

ifFalse

Gets or sets selector if condition is false.

ifTrue

Gets or sets selector if condition is true.

parser

Gets or sets the expression parser to use.

Methods

getConverter(Object)

Gets the converter for the selector configuration.

initialize(OnCondition[], boolean)

Initialize the selector with the set of rules.

select(ActionContext)

Select the best rule to execute.

Inherited Methods

configure(Record<string, unknown>)

Fluent method for configuring the object.

Property Details

$kind

static $kind: string

Property Value

string

condition

Expression that determines which selector to use.

condition: BoolExpression

Property Value

BoolExpression

ifFalse

Gets or sets selector if condition is false.

ifFalse: TriggerSelector

Property Value

ifTrue

Gets or sets selector if condition is true.

ifTrue: TriggerSelector

Property Value

parser

Gets or sets the expression parser to use.

parser: ExpressionParserInterface

Property Value

ExpressionParserInterface

Method Details

getConverter(Object)

Gets the converter for the selector configuration.

function getConverter(property: Object): Converter | ConverterFactory

Parameters

property

Object

The key of the conditional selector configuration.

Returns

Converter | ConverterFactory

The converter for the selector configuration.

initialize(OnCondition[], boolean)

Initialize the selector with the set of rules.

function initialize(conditionals: OnCondition[], evaluate: boolean)

Parameters

conditionals

OnCondition[]

Possible rules to match.

evaluate

boolean

True if rules should be evaluated on select.

select(ActionContext)

Select the best rule to execute.

function select(actionContext: ActionContext): Promise<OnCondition[]>

Parameters

actionContext
ActionContext

Dialog context for evaluation.

Returns

Promise<OnCondition[]>

A Promise with a number array.

Inherited Method Details

configure(Record<string, unknown>)

Fluent method for configuring the object.

function configure(config: Record<string, unknown>): this

Parameters

config

Record<string, unknown>

Configuration settings to apply.

Returns

this

The Configurable after the operation is complete.

Inherited From Configurable.configure