Task Activity Notification

Note

Cisco Finesse TaskActivity API enables gadgets on the Finesse desktop to listen to and provide information about the user's multi-channel task-related activity in Unified CCE. Task activity status corresponding to multiple media that agents are signed in to can be published or subscribed by using this API.

Unlike traditional desktop APIs, the information provided by this API is only produced and consumed by gadgets on the Finesse desktop. Therefore using this API requires supporting gadgets that can consume or produce this information to be deployed.

Class finesse.containerservices.TaskActivityNotification

Provides a framework to notify and receive updates about the digital task activity status. The notifications inform the desktop and other subscribers about which non-voice media dialog is currently active or inactive.

Note

This is supported from Cisco Finesse, Release 12.5(1) ES3 onwards.

Example

Code Snippet
Copyvar taskActivityNotification = finesse.containerservices.TaskActivityNotification.init(containerServices);

Methods

init()

Initializes the TaskActivityNotification object.

Example

Code Snippet
Copyvar taskActivityNotification = finesse.containerservices.TaskActivityNotification.init(containerServices);

Returns

{finesse.containerservices.TaskActivityNotification} The initialized finesse.containerservices.TaskActivityNotification reference.

notifyTaskSelection(from, message)

Notifies the subscribing gadgets about a task becoming active or inactive through the OpenAjax hub. The from parameter uniquely identifies the publishing gadget, and the message parameter contains the payload that is being published, with the details of the task.

Example

Code Snippet
Copyvar taskActivityNotification = finesse.containerservices.TaskActivityNotification.init(containerServices);

var from = "Gadget_id";

var message = {
    'timestamp': 1589780515222, // optional
    'taskId': 'task_id'
    'active': true,
    'mediaType': 'Chat',
    'contextInfo': {
        // optional
    }
}

taskActivityNotification.notifyTaskSelection(from, message);

Parameters

Name

Type

Description

Required

from

String

An identifier for the gadget that publishes notifications.

Yes

message

String

The task activity selection message to be published to the OpenAjax hub.

Yes

-->timestamp

Number

The Unix Epoch timestamp at which the message was generated. If the value is not present, Finesse automatically populates it with the time at which the API request was made.

Optional

-->taskId

String

Unique identifier for the task.

Note

The taskID used must correspond to the ID of an existing Finesse MediaDialog. This requirement exists since gadgets on the Finesse desktop does not know about tasks outside of those provided by the digital channel APIs.

Yes

-->active

Boolean

Determines the task activity status.

  • True—If the task is active.

  • False—If the task is inactive.

Yes

-->mediaType

String

The type of media under which the dialog is classified. For example, Chat and Email.

Yes

-->contextInfo

Object

Any additional information in JSON format.

Optional

registerForTaskNotifications(callback)

Registers the gadget for receiving task activity notifications issued by other gadgets, through the callback provided as a parameter to the registration.

Example

Code Snippet
Copyvar taskActivityNotification = finesse.containerservices.TaskActivityNotification.init(containerServices);
 
// register to receive task notifications
taskActivityNotification.registerForTaskNotifications(_processTaskNotifications);

Parameters

Name

Type

Description

Required

callback

Function

Callback function that is invoked when a task activity notification message is received.

Yes

requestCurrentTasks()

Request to receive the last published task activity notifications from all gadgets that are actively publishing task notifications. This API is intended to be used when gadgets interested in task notifications initializes itself. Therefore, the current task activity status, which might have been missed while the gadget was initializing or loading, can be received. This API must be invoked only after registering for notifications.

Example

Code Snippet
Copyvar taskActivityNotification = finesse.containerservices.TaskActivityNotification.init(containerServices);
 
// register to receive task notifications
taskActivityNotification.registerForTaskNotifications(_processTaskNotifications);
 
// request for a task notification
taskActivityNotification.requestCurrentTasks();

Throws

{Error} If the callback function is not registered using TaskActivityNotification.registerForTaskNotifications.