-
Notifications
You must be signed in to change notification settings - Fork 10
Creating a Nexus Bridge instance
You create a new instance of the Nexus Bridge passing the instance of applet's Presentation Model (PM).
The way you create the instance of the Nexus Bridge depends on how you included the Nexus Bridge into your project:
- IIFE as done in Setup Nexus Bridge:
const nexus = new SiebelAppFacade.NexusBridge({pm});
- Dependency
import Nexus from '@ideaportriga/nexus-bridge';
const nexus = new Nexus ({pm});
The Nexus Bridge creation settings:
The custom PR application can create the instances of the Nexus Bridge:
(View applets)[Applets-in-Nexus-Bridge#View-Applets-and-Popup-Applets]
const nexus = [];
const appletmap = SiebelApp.S_App.GetActiveView().GetAppletMap();
for (const applet in appletmap) {
const pm = appletmap[applet].GetPModel();
nexus.push(new SiebelAppFacade.NexusBridge({ pm, convertDates: true }));
}
For popup applet
As outcome of the Oracle review, the Nexus Bridge is not allowed to use the GetPModel function and advised to create the instances of the Nexus Bridge in applet PRs.
-
Overrides Init, BindData, BindEvents, and ShowUI, and does not call the methods of superclasses.
-
Injects the external application that manipulates with Siebel Data using the instances of Nexus Bridge (not shown in the piece of the code below).
if (typeof (SiebelAppFacade.DefaultViewPR) === "undefined") {
SiebelJS.Namespace("SiebelAppFacade.DefaultViewPR");
define("siebel/custom/DefaultViewPR", ["siebel/viewpr"],
function () {
SiebelAppFacade.DefaultViewPR = (function () {
function DefaultViewPR(pm) {
SiebelAppFacade.DefaultViewPR.superclass.constructor.apply(this, arguments);
}
SiebelJS.Extend(DefaultViewPR, SiebelAppFacade.ViewPR);
DefaultViewPR.prototype.Init = function () { }
DefaultViewPR.prototype.ShowUI = function () { }
DefaultViewPR.prototype.BindData = function () { }
DefaultViewPR.prototype.BindEvents = function () { }
DefaultViewPR.prototype.EndLife = function () {
SiebelAppFacade.DefaultViewPR.superclass.EndLife.apply(this, arguments);
}
return DefaultViewPR;
}()
);
return "SiebelAppFacade.DefaultViewPR";
})
}
The Nexus Bridge instances are not independent. Standard Siebel functionality is also triggered when you are manipulating the Nexus Bridge instances. For example, when one Nexus Bridge instance is in the process of creating a new record, manipulating the another instance could cause the implicit write record in the first instance.