Skip to Content
0
Aug 17, 2018 at 03:44 AM

Fiori launchpad becomes unresponsive after chatbot plugin deployment

390 Views Last edit May 24, 2020 at 11:23 AM 2 rev

Hi experts,

We have developed chatbot functionality for our on-premise ERP using Recast.AI.

Basically, we have deployed a plugin on the On-Premise Fiori launchpad using the following code; However the Fiori launchpad freezes after the chatbot launches and we cannot execute anything on the Fiori Launchpad. The options in SAP Note 2544600 haven't helped us. Any idea, what could be the issue?

Regards,

Karan

sap.ui.define([
	"sap/ui/core/UIComponent",

], function (UIComponent) {
	"use strict";


	return UIComponent.extend("com.abc.chatbot.Component", {

		/**
		 * The component is initialized by UI5 automatically during the startup of the app and calls the init method once.
		 * @public
		 * @override
		 */
		init: function () {
			// call the base component's init function
			UIComponent.prototype.init.apply(this, arguments);
			var renderer = sap.ushell.Container.getRenderer("fiori2");
			if (!document.getElementById("recast-webchat")) {


				var s = document.createElement("script");
				s.setAttribute("id", "recast-webchat");
				s.setAttribute("src", "https://cdn.recast.ai/webchat/webchat.js");
				//document.body.appendChild(s);
				if (document.body != null) {
					document.body.appendChild(s);
				}
			}
			s.setAttribute("channelId", "abc");
			s.setAttribute("token", "xyz");
		}
	});
});