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.
@NotNull kotlin.jvm.functions.Function1<ai.tock.bot.engine.BotBus,java.lang.Boolean> selectFromBus()
Does this Step has to be selected from the Bus?
This method is called if StoryHandlerBase.checkPreconditions does not call BotBus.end.
If this functions returns true, the step is selected and remaining steps are not tested.
StoryHandlerBase.checkPreconditions,
BotBus.endboolean selectFromAction(@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.
@Nullable
java.lang.Boolean selectFromEntityStepSelection(@NotNull
Action action,
@Nullable
Intent intent)
Does this step hast to be selected from its entityStepSelection?
Returns null if there is no entityStepSelection.
entityStepSelection,
entityStepSelectionboolean 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.
@Nullable EntityStepSelection getEntityStepSelection()
If not null, entity has to be set in the current action to trigger the step.