public StoryStep<T extends StoryHandlerDefinition>
A step (the implementation is usually an enum) is a part of a interface StoryDefinition.
Used to manage workflow in a interface StoryHandler.
interface StoryDefinition,
interface StoryHandler@NotNull java.lang.String getName()
The name of the step. usually automatically defined by the enum field.
@NotNull kotlin.jvm.functions.Function1<T,java.lang.Object> answer()
The custom answer for this step. When returning a null value, it means that the step is not able to answer to the current request.
Default implementation returns null.
@NotNull IntentAware getBaseIntent()
Returns intent or the StoryDefinition.mainIntent if intent is null.
intent,
StoryDefinition.mainIntent,
intent@Nullable IntentAware getIntent()
The main intent of the step.
If not null and if the current intent is equals to intent,
this step will be automatically selected to be the current step.
intent@NotNull java.util.Set<ai.tock.bot.definition.IntentAware> getOtherStarterIntents()
Same behaviour than intent in the rare case when the step handle more than one intent.
intent@NotNull java.util.Set<ai.tock.bot.definition.IntentAware> getSecondaryIntents()
The secondary intents of this step. If detected and if the current step is this step, the current step remains this step.
boolean select(@NotNull
UserTimeline userTimeline,
@NotNull
Dialog dialog,
@NotNull
Action action,
@Nullable
Intent intent)
Does this Step has to be automatically selected? if returns true, the step is selected.
boolean supportStarterIntent(@NotNull
Intent i)
Does this step support this intent as starter intent?
boolean supportIntent(@NotNull
Intent i)
Does this step support this intent?
@NotNull java.util.Set<ai.tock.bot.definition.StoryStep> getChildren()
The optional children of the step.