Skip to main content

BotContent

Container for all bot activities (conversation flows). One BotContent per Tenant. Activities are compiled into BotContentCompiled for runtime execution. Collection: bot-contents | DB: MongoDB Source: hbf-core/src/main/java/gr/helvia/hbf/core/domain/content/BotContent.kt TypeScript: hbf-core-api/src/datamodel/botContent.ts

Fields

FieldTypeRequiredIndexedNotes
idStringyesPKMongoDB document ID
activitiesList<Activity>yesDefault empty list
mainActivityStringnoActivity ID of main entry point
staticVariablesList<StaticVariable>yesBot-level variables
createdAtDateyes@CreatedDate
updatedAtDateyes@LastModifiedDate

Nested Objects

Activity

A logically related set of conversation content (a flow).

FieldTypeNotes
idString@Id, @NotNull
nameLocalized<String>Multilingual name, max 254 chars
schemaActivitySchema@NotNull. "FLOWGRAPH" or "FAQLITE"
groupLocalized<String>Activity group name
typeActivityType@NotNull
nlpTrainingDataNLPTrainingDataOptional
contentActivityContent@NotNull, @Valid. FlowGraphContent implementation
tagsList<String>Default empty
settingsActivitySettingsOptional
createdAtDate
forceOverwriteBoolean@Transient, default false

ActivitySettings

FieldTypeNotes
storeAnswersByDefaultBooleanDefault: false
automaticBackButtonForLeafMessagesBoolean
defaultInlineUserFeedbackDataInlineFeedbackData
useGeneratedResponseBoolean
defaultLanguageLanguageCode

NLPTrainingData

FieldTypeNotes
articleIdStringKB article ID for training
supportedLanguagesList<String>
examplesLocalized<List<String>>Per-language example phrases

InlineFeedbackData

FieldTypeNotes
enabledBoolean
positiveInlineFeedbackElement
negativeInlineFeedbackElement

InlineFeedbackElement

FieldTypeNotes
tagsList<String>Tags for analytics
feedbackNodeIdStringConvNode ID to jump to

StaticVariable

FieldTypeNotes
nameStringVariable name
valueStringVariable value
descriptionStringOptional
isConstantBooleanDefault: false. If true, immutable at runtime
createdAtDate
updatedAtDate

FlowGraphContent (implements ActivityContent)

FieldTypeNotes
nodesList<FlowGraphNode>@NotNull, @UniqueNodeIds. See flow-graph-nodes.md
edgesList<FlowGraphEdge>
layoutFlowGraphLayoutVERTICAL or HORIZONTAL, default VERTICAL

FlowGraphEdge

FieldTypeNotes
idString@NotNull
sourceString@NotNull, source node ID
targetString@NotNull, target node ID
labelStringDefault ""
sourcePositionIdStringFor multi-output nodes

BotContentCompiled

Compiled version of BotContent, generated at compile time for runtime execution.

Collection: bot-contents-compiled

FieldTypeNotes
idStringPK
activitiesList<ActivityCompiled>
customActivitiesList<ActivityCompiled>
metadataBotContentCompilationMetadata
createdAtDate@CreatedDate
updatedAtDate@LastModifiedDate

ActivityCompiled

FieldTypeNotes
idString
typeString or ActivityType
nameLocalized<String>
conversationNodesList<ConversationNode>
responsesResponsesRecord<string, Localized<Response[]>>
metadataActivityCompilationMetadata

BotContentCompilationMetadata

FieldTypeNotes
entryPointsList<EntryPoint>Node ID + source activity
variablesList<VariableSpec>
jumpsToRecord<String, String[]>Activity ID to target activity IDs

Enums

ActivityType

ValueDescription
DECISION_TREEStandard decision tree flow
LIVECHAT_FLOWLive chat handler flow
AUTOMATED_ANSWERSFAQ/automated answers flow
INTERVIEWInterview/survey flow
USER_FEEDBACKUser feedback collection
KNOWLEDGE_BASEKnowledge base article flow
LIVECHAT_SYSTEM_MESSAGESystem message for live chat

ActivitySchema

ValueDescription
FLOWGRAPHVisual flow graph editor
FAQLITESimplified FAQ editor

FlowGraphLayout

ValueDescription
VERTICALTop-to-bottom layout
HORIZONTALLeft-to-right layout

Relationships

  • Belongs to: Tenant (one BotContent per Tenant, via @DBRef)
  • Contains: Activity objects (composition)
  • Compiled into: BotContentCompiled
  • Activities contain: FlowGraphContent with FlowGraphNode and FlowGraphEdge

TypeScript Mapping

hbf-core (Kotlin)hbf-core-api (TypeScript)Notes
BotContentBotContentTS omits staticVariables, createdAt, updatedAt
BotContentCompiledBotContentCompiledAligned
ActivityActivityAligned
ActivityCompiledActivityCompiledAligned
ActivityTypeActivityType (const enum)Aligned
StaticVariableVariableSpecDifferent naming, TS adds type, fromActivity
FlowGraphContent(not exported)Gap: FlowGraphContent is internal to hbf-core
FlowGraphEdge(not exported)Gap: not in hbf-core-api
NLPTrainingDataNLPTrainingDataAligned
ActivitySettingsActivitySettingsAligned