-
- All Implemented Interfaces:
-
ai.tock.bot.definition.StoryDataStep,ai.tock.bot.definition.StoryStep
public abstract class StoryDataStepBase<T extends StoryHandlerDefinition, TD extends Object, D extends Object> implements StoryDataStep<T, TD, D>
Base class for StoryDataStep implementations.
-
-
Field Summary
Fields Modifier and Type Field Description private final Stringnameprivate final IntentAwarebaseIntentprivate final IntentAwareintentprivate final Set<IntentAware>otherStarterIntentsprivate final Set<IntentAware>secondaryIntentsprivate final Set<StoryStep<T>>childrenprivate final BooleanhasNoChildrenprivate final EntityStepSelectionentityStepSelection
-
Method Summary
Modifier and Type Method Description final Function2<TD, T, Boolean>select()final Function2<T, TD, D>setup()final Function2<T, D, Object>reply()final Objectexecute(T storyDef, TD configuration)final Function2<T, TD, Boolean>selectFromBusAndData()Does this Step has to be selected from the Bus? final Function2<T, TD, D>checkPreconditions()Checks preconditions - if BotBus. final Function2<T, D, Object>handler()The custom handler for this step. StringgetName()IntentAwaregetBaseIntent()IntentAwaregetIntent()Set<IntentAware>getOtherStarterIntents()Set<IntentAware>getSecondaryIntents()Set<StoryStep<T>>getChildren()BooleangetHasNoChildren()EntityStepSelectiongetEntityStepSelection()-
Methods inherited from class ai.tock.bot.definition.StoryDataStepBase
answer -
Methods inherited from class ai.tock.bot.definition.StoryDataStep
selectFromAction, selectFromActionAndEntityStepSelection, selectFromBus, selectFromDialog, selectFromDialogAndEntityStepSelection, supportIntent, supportStarterIntent -
Methods inherited from class ai.tock.bot.definition.StoryStep
equals, hashCode, toString -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
selectFromBusAndData
final Function2<T, TD, Boolean> selectFromBusAndData()
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.
-
checkPreconditions
final Function2<T, TD, D> checkPreconditions()
Checks preconditions - if BotBus.end is called, StoryHandlerDefinition.handle is not called and the handling of bot answer is over. Returned data is used in subsequent call of handler if not null
else StoryHandlerBase.checkPreconditions returned data is used.
-
handler
final Function2<T, D, Object> handler()
The custom handler 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.
-
getBaseIntent
IntentAware getBaseIntent()
-
getIntent
IntentAware getIntent()
-
getOtherStarterIntents
Set<IntentAware> getOtherStarterIntents()
-
getSecondaryIntents
Set<IntentAware> getSecondaryIntents()
-
getChildren
Set<StoryStep<T>> getChildren()
-
getHasNoChildren
Boolean getHasNoChildren()
-
getEntityStepSelection
EntityStepSelection getEntityStepSelection()
-
-
-
-