public static class StoryStep.DefaultImpls
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 public static kotlin.jvm.functions.Function1<T,java.lang.Object> answer(StoryStep<T> $this)
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 public static IntentAware getBaseIntent(StoryStep<T> $this)
Returns intent or the StoryDefinition.mainIntent if intent is null.
intent,
StoryDefinition.mainIntent,
intent@Nullable public static IntentAware getIntent(StoryStep<T> $this)
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 public static java.util.Set<ai.tock.bot.definition.IntentAware> getOtherStarterIntents(StoryStep<T> $this)
Same behaviour than intent in the rare case when the step handle more than one intent.
intent@NotNull public static java.util.Set<ai.tock.bot.definition.IntentAware> getSecondaryIntents(StoryStep<T> $this)
The secondary intents of this step. If detected and if the current step is this step, the current step remains this step.
@NotNull public static kotlin.jvm.functions.Function1<ai.tock.bot.engine.BotBus,java.lang.Boolean> selectFromBus(StoryStep<T> $this)
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.endpublic static boolean selectFromAction(StoryStep<T> $this, @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 public static java.lang.Boolean selectFromEntityStepSelection(StoryStep<T> $this, @NotNull Action action, @Nullable Intent intent)
Does this step hast to be selected from its entityStepSelection?
Returns null if there is no entityStepSelection.
entityStepSelection,
entityStepSelectionpublic static boolean supportStarterIntent(StoryStep<T> $this, @NotNull Intent i)
Does this step support this intent as starter intent?
public static boolean supportIntent(StoryStep<T> $this, @NotNull Intent i)
Does this step support this intent?
@NotNull public static java.util.Set<ai.tock.bot.definition.StoryStep> getChildren(StoryStep<T> $this)
The optional children of the step.
@Nullable public static EntityStepSelection getEntityStepSelection(StoryStep<T> $this)
If not null, entity has to be set in the current action to trigger the step.