-
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 external application can use the following approach to create the instances of Nexus Bridge
class for each applet:
SiebelAppFacade.NB = SiebelAppFacade.NB || {};
const appletmap = SiebelApp.S_App.GetActiveView().GetAppletMap();
for (const applet in appletmap) {
const pm = appletmap[applet].GetPModel();
SiebelAppFacade.NB[appletName] = new SiebelAppFacade.NexusBridge({ pm, convertDates: true });
}
The created instances of the Nexus Bridge
is not necessarily needed to be stored in SiebelAppFacade
.
As outcome of the Oracle review, the NexusBridge is not allowed to use the GetPModel function and were recommended to use PR for initializing the instance of the Nexus Bridge.
-
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're manipulating 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 of the first instance.