The business process in the Creatio works as a bot handler. A dialogue tree is configured using the business process elements.

Follow the following steps to create your own dialogue tree:

  1. Add a new business process. To do that follow one of the ways:

    Untitled

  2. Add the following business process parameters:

    Title Code Data type Parameter purpose
    ChatId ChatId Text (50 characters) This is the current dialogue ID in the [Dialogue] section.
    Answer_From_FirstName AnswerFromFirstName Text (50 characters) This is the user's name in the messenger, who is now speaking with the bot.
    Note: this data is open in the messenger.
    Answer_From_LastName AnswerFromLastName Text (50 characters) This is the user's surname in the messenger, who is now speaking with the bot.
    Note: this data is open in the messenger.
    Answer_From_UserName AnswerFromUserName Text (50 characters) This is the username in the messenger, who is now speaking with the bot.
    Note: this data is open in the messenger.
    Answer_From_Id AnswerFromId Text (50 characters) This is the user's identifier in the messenger, who is now speaking with the bot.
    Note: this data is open in the messenger.
    Answer Answer Text (50 characters) This is the user's initial message to the bot in the ongoing dialogue.
    Mailing category MailingCategoryId Unique identifier This is the messenger where the communication is going on right now.
  3. Add the [Bot settings] element to the schema designer diagram and fill in its parameters:

    Untitled

    <aside> 📢 Attention: If nothing is displayed in the [Config] tab when opening the element settings and the error is in the console, it is necessary to check that the data is set correctly in the TsiVarCharStaticFile and TsiVarCharacterConfig data binds.

    Untitled

    If the data is set correctly (there is no error in the system configuration), reinstall these data binds or contact the system administrator.

    To reinstall data, execute the next script on DB.

    update SysPackageSchemaData set NeedInstall = 1 where Name like 'TsiVar%';
    

    </aside>

  4. Add a [Bot message] element and configure the message.

    <aside> 💡 Note: More details about settings up a message are described in the Bot-message configuration article.

    </aside>

    Untitled

  5. Save all business process settings.

  6. Specify this business process as the bot handler in the [Bot] section. More details about it are here.

Besides, you can set up a dialogue closing. It can be after the execution of all the business process elements or after receiving a signal of a button clicking or another user response. To do this follow these steps:

  1. Add a [Start] element.

  2. Choose the ‘…’ type of this start element.

  3. Enter the ‘…’ signal into it.

  4. Add a [Changing data] element and specify the parameters:

    Parameter Value
    Which object data should be changed? Dialogue
    Change all records that match a condition
    [Dialogue].[Id] Map to the [Chat] business process parameter.
    What field values should be set for modified records?
    End date Map to the [Current date and time] system variable.
    Status Select the ‘Close’ item in the [Dialogue status] lookup.
  5. Connect with the final element.

  6. Finally, save all of the changes.

See also

Setting up chatbot messages timeout

Setting up bot schedule