Package ai.tock.bot.definition
Interface StoryDataStep
-
- All Implemented Interfaces:
-
ai.tock.bot.definition.StoryStep
public interface StoryDataStep<T extends StoryHandlerDefinition, TD extends Object, D extends Object> implements StoryStep<T>
A step that can have specific preconditions and can use input data object in handler.
-
-
Method Summary
Modifier and Type Method Description Function1<T, Object>answer()The custom answer for this step. Function2<T, TD, Boolean>selectFromBusAndData()Does this Step has to be selected from the Bus? 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. Function2<T, D, Object>handler()The custom handler for this step. -
Methods inherited from class ai.tock.bot.definition.StoryStep
getBaseIntent, getChildren, getEntityStepSelection, getHasNoChildren, getIntent, getMetrics, getName, getOtherStarterIntents, getSecondaryIntents, selectFromAction, selectFromActionAndEntityStepSelection, selectFromBus, selectFromDialog, selectFromDialogAndEntityStepSelection, supportIntent, supportStarterIntent -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
answer
Function1<T, 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.
-
selectFromBusAndData
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
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.
-
-
-
-