Skip to content

Creating a Nexus Bridge instance

Oleg edited this page Nov 27, 2019 · 24 revisions

Make sure that Nexus Bridge library is loaded and available for application as described in [Nexus-Bridge-Setup](Setup -Nexus19).

Create a new instance of the Nexus Bridge

The class definition is stored in SiebelAppFacade.NexusBridge, and the new instance of the Nexus Bridge could be created using the instance of the applet's Presentation Model: new SiebelAppFacade.NexusBridge({pm}).

The class also exported as ES6 class: export default class Nexus. The name of the class could be changed in future.

Note: In future the Nexus Bridge will be publsihed as an npm package, so the application could install it as a dependency.

Please pay attention to the optional creation settings: convertDates, returnRawNumbers, and returnRawCurrencies.

Note: the creation settings are propagated to the Nexus popup instances created by the popup controller, therefore to avoid ambiguousness it is better to create all Nexus instances with the same settings.

Each applet configured on the Siebel View is represented by the separate instance of the Nexus Bridge.

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.

Initialization Example

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.