EngagementContext
This context we get in the response of startCommEvent operation's response by calling getEngagementContext API.
This object will encapsulate the tabContext in which the new call connection has been established, which means the user can get control over the objects being opened by that call connection. The getEngagementContext API can be called from IMcaStartComActionData which is the object we get by calling getResponseData API on the IMcaStartComActionResponse object. IMcaStartComActionResponse object is the response of StartCommEvent operation.
Syntax
getEngagementContext(): IEngagementContext;
Here's a Typescript example of how you can access EngagementContext:
const uiEventsFrameworkInstance: IUiEventsFrameworkProvider = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const multiChannelAdaptorContext: IMultiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext();
const phoneContext: IPhoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE') as IPhoneContext;
const request: IMcaStartCommEventActionRequest = uiEventsFrameworkInstance.requestHelper.createPublishRequest('startCommEvent') as IMcaStartCommEventActionRequest;
// You should set correct appClassification here. eg: ORA_SERVICE for Service App
// Refer https://docs.oracle.com/en/cloud/saas/fusion-service/fairs/application-classification-code.html#s20059918 for the list of supported app classifications
request.setAppClassification('appClassfication');
request.setEventId('1'); // Set the event ID here
// request.setInputData(_inboundData);// _inboundData of type - IMcaStartCommInData
const inData: IMcaStartCommInDataRequest = request.getInData();
phoneContext.publish(request).then((res: IOperationResponse) => {
const response: IMcaStartComActionResponse = res as IMcaStartComActionResponse;
const startCommData: IMcaStartComActionData = response.getResponseData();
const engagementContext: IEngagementContext = startCommData.getEngagementContext();
})
Here's a Javascript example of how you can access EngagementContext:
const uiEventsFrameworkInstance = await CX_SVC_UI_EVENTS_FRAMEWORK.uiEventsFramework.initialize('appname', 'v1');
const multiChannelAdaptorContext = await uiEventsFrameworkInstance.getMultiChannelAdaptorContext();
const phoneContext = await multiChannelAdaptorContext.getCommunicationChannelContext('PHONE');
const request = uiEventsFrameworkInstance.requestHelper.createPublishRequest('startCommEvent');
// You should set correct appClassification here. eg: ORA_SERVICE for Service App
// Refer to Application Classification Code for the list of supported app classifications
request.setAppClassification('appClassfication');
request.setEventId('1'); // Set the event ID here
const inData = request.getInData();
phoneContext.publish(request).then((response) => {
const startCommData = response.getResponseData();
const engagementContext = startCommData.getEngagementContext();
})
Supported Operations
Method Name | Description | Example |
---|---|---|
FeedLiveTranscript | This operation is used to add live transcript messages during an ongoing phone call. | FeedLiveTranscript |
FeedSystemMessage | This operation is used to add system messages during an ongoing phone call. | FeedSystemMessage |
Supported Methods
Method Name | Description | Example |
---|---|---|
getEngagementId | The unique ID of the engagement object. | See getEngagementId entry in IEngagementContext. |
getTabContext | The TabContext in which the engagement is opened in the UI. Using this context you can access the records opened in that tabContext and perform actions. All APIs added on a TabContext object will hold true on the return value of this API. | See getTabContext entry in IEngagementContext. |
getEngagementData | The function to fetch the data in that engagement object. | See getEngagementData entry in IEngagementContext. |
getChannelType | The function to get the channel type in PhoneContext API requests, such as ORA_SVC_PHONE. | See getChannelType entry in IEngagementContext. |
getChannel | The function to get the type in context object. The value is PHONE. | See getChannel entry in IEngagementContext. |
getWrapupContext | The function to fetch the Wrapup RecordContext on the startComm and closeComm if Wrapup is available in the UI. | See getWrapupContext entry in RecordContext. |