-
Notifications
You must be signed in to change notification settings - Fork 4
BotWorks 106: Is there a magic button?
Gary Anderson edited this page Nov 29, 2018
·
1 revision
Explaining the operation of the Bot ecosystem has challenges. On the one hand Bots are very simple. Almost all of the functionality of the system is handled by the BaseBot Java class, which is not something that anyone needs to modify. The Bots that specialize in certain tasks tend to have extremely simple code. The difficulty in explaining the Bot operation seems to be related to these features:
- The content of an incoming Bot Message determines the how and what is executed in as the Bot processes the message.
- The 'data' section in the Bot Message provides the variable context for the execution. Remember the content of the 'data' section was created by a previous Bot.
- The transformation of the 'data' section into a format suitable for execution is done by rendering a StringTemplate (AppTemplate) using the variable data. This StringTemplate was specified in the incoming message and the Bot responsible for processing the message.
- The output of the AppTemplate rendering will typically be 'business logic' which will be executed by the Bot. For example, in the case of the JDBCBot, the rendered AppTemplate is probably an SQL statement which the JDBCBot will just execute.
- Once the Bot has executed the business logic, the output from that step (if any) will be used when rendering the Output Message that the Bot will process.
- The output message published by a Bot is determined by the output StringTemplate specified in the incoming message.
- It appears that things happen when they are supposed to happen and Bots do what they are told by other Bots who are unaware of their existence.
** Bottom Line** - There is no magic button there are only carefully designed StringTemplates and simply coded Bots.