How to Use UI Events Framework

To expose an API in the UI Events Framework, here are the general steps to follow:

Prerequisites

  1. Load the external application in the Service Center using the oj-cx-svc-common-ui-events-container component.
  2. Load UI Events Framework library file in external application's HTML or DOM file.

Overview of the Steps

  1. Initialize the framework.
  2. Get the required context for the use case.
  3. Generate request object using requestHelper.
  4. Invoke the APIS exposed in the above contexts.

Initialize UI Events Framework

Now you initialize the framework using an application name for any interaction. Once the framework is initialized successfully, you can get the reference to the instance of IUiEventsFrameworkProvider. All the interactions happening from this object can be tracked with the application name provided during the initialization.

Here's an example of the syntax for initallizing the UI Events Framework:
initialize(applicationId: string, version?: string): Promise<IUiEventsFrameworkProvider>;

Parameters

Parameter Name Required Description
applicationId Yes Users must call the initialize function with a unique application ID to use the UI Events Framework. The application ID helps debug purposes when testing.
version No Oracle aims maintain backward compatibility for all the releases. If in the future, the framework deprecates some APIs without backward compatibility, use this parameter to load older or newer versions of the library. Currently, the version value defaults to v1.
The following code example shows an example in TypeScript:
/// <reference path="uiEventsFramework.d.ts"/>
const frameworkProvider: CX_SVC_UI_EVENTS_FRAMEWORK.IUiEventsFrameworkProvider = await 
CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID');
The following code example shows an example in JavaScript:
const frameworkProvider = await 
CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('MyFirstExtensionID');

Retrieve the Corresponding Context for the Use Case

Once you can retrieve the instance of IUiEventsFrameworkProvider, you can now choose the context based on use cases.

The UiEventsFrameworkProvider provides three contexts as shown in the following:
  • GlobalContext
  • TabContext
  • RecordContext

All the extensible events and actions of UEF are supported on top of contexts like GlobalContext, TabContext, and RecordContext. The following diagram shows the hierarchy of these contexts that are maintained in UEF and the supported events, actions, and APIs supported in each context:

The following graphic shows the overall architecture:

A graphic of the overall architecture.