【问题标题】:How can I send a custom event to the client browser using Power Virtual Agents?如何使用 Power Virtual Agents 将自定义事件发送到客户端浏览器?
【发布时间】:2021-02-12 15:59:15
【问题描述】:

我正在使用 Power Virtual Agents 构建一个机器人并将其集成到我的网站上。客户可以使用 Flow 通过机器人创建支持票证。我需要在创建工单后更新我的网页以刷新页面上的工单列表。我该怎么做?

【问题讨论】:

    标签: power-virtual-agents


    【解决方案1】:

    您可以创建一个新的Adaptive Dialog in Bot Framework Composer 来向客户端发送一个事件活动。具体来说:

    1. 点击主题列表页面的“Open in Bot Framework”按钮,在composer中打开bot。
    2. 要将状态从机器人传输到客户端,您必须将适用的变量设置为 Power Virtual Agents 中的整个机器人。在创建工单的主题中,确保将 ticketId 变量标记为全局变量。
    3. 在机器人中创建一个新对话框。在BeginDialog 触发器中,添加一个包含结构化事件负载的Send a response 节点:
    [EventActivity
        name = OnTicketCreated
        value = ${virtualagent.ticketId}
    ]
    
    1. 将 Composer 中的更改发布到 Power Virtual Agents。
    2. 在创建工单的主题末尾,添加一个Go to another topic 节点并将机器人路由到新创建的对话框。
    3. 在客户端,使用WebChat.createStore() 函数处理事件。 Here is sample code

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-08-03
      • 2018-04-06
      • 2010-09-30
      • 2018-01-31
      • 2016-06-16
      • 2021-06-07
      • 1970-01-01
      相关资源
      最近更新 更多