Interactive web conversation report that renders a live chat UI in the browser.
ObjReportConversation embeds a bot-driven conversation directly in an Axion
web page. It uses RemoteProcedureCall() to stream new messages and route user
input through the WEB conversation engine (ObjConversationWeb).
Messages are persisted in data_web_conversation and are never fetched via an
external webhook — the report reads and writes the database directly through
ConversationBroker.
data_list[0] = [conversation_id, contact_id]
| Index | Value |
|---|---|
[0] |
ConversationCode matching a def_conversation row |
[1] |
Stable contact identifier (user GUID or anonymous UUID) |
RpcConversation(data)Polls data_web_conversation for messages newer than the current cursor.
Input keys from data:
| Key | Description |
|---|---|
conversation_id |
Conversation code |
contact_id |
Session user identifier |
conversation_guid |
Unique per browser tab |
last_stamp |
Last seen timestamp (YYYY-MM-DD HH:MM:SS) |
last_id |
Last seen row id (preferred cursor) |
Returns:
[new_last_stamp, new_last_id, html_string, has_bot_message]
html_string is '' when there are no new messages.has_bot_message is true when at least one bot message was returned.RpcSendmessage(data)Stores the user message and triggers the conversation engine, then returns
refreshed messages via RpcConversation.
Input keys: same as RpcConversation plus message.
Returns the same tuple shape as RpcConversation.
Render(Param1, Param2, Param3)Called by the report engine. Reads conversation_id and contact_id from
data_list[0], generates a fresh session ConversationGuid, fetches initial
messages, and returns the full chat UI HTML.
The rendered HTML includes:
direct-chat-messages div (id="chat_canvas_{guid}") that receivessetInterval calling update_messages_{guid} every 10 seconds.submit_message_{guid}().RemoteProcedureCall({
baseurl: '{baseurl}/report',
object: '{reportcode}',
method: 'conversation', // or 'sendmessage'
conversation_id: '...',
conversation_guid: '...',
contact_id: '...',
last_stamp: last_stamp,
last_id: last_id
}).then(function(data) {
last_stamp = data[0];
last_id = data[1];
if (data[2] !== '') {
$('#chat_canvas_{guid}').append(data[2]);
}
});
def_conversation entry and a def_conversation_detail row withChannel = 'WEB'.def_report row pointing to ObjReportConversation.data_list = [["MYBOT", "contact-id"]].See ObjConversationWeb.md for database schema details.