WatchedInteraction class

Member of ININ.Addins.IC.Interactions Since 2016 R1 API Version 1

new WatchedInteraction(interactionId)

Implements ININ.Addins.IC.ISubscription, ININ.Addins.IC.Interactions.IInteraction

Represents a live view of an interaction and a subset of attributes associated with the interaction.

Parameters

Name Type Description
interactionId string

The identifier of the interaction.

Example

var interactionId = // an interaction ID
var watchedInteraction = new ININ.Addins.IC.Interactions.WatchedInteraction(interactionId);
watchedInteraction.on("attributesChanged", function() {
    console.log("The " + watchedInteraction.getAttribute(ININ.Addins.IC.Interactions.attributeNames.interactionType)
        + " interaction " + watchedInteraction.interactionId + " is now in state: " +
        watchedInteraction.getAttribute(ININ.Addins.IC.Interactions.attributeNames.stateDisplay));
});
watchedInteraction.subscribe({
    attributeNames: [
        "CUSTOM_ATTRIBUTE",
        ININ.Addins.IC.Interactions.attributeNames.stateDisplay,
        ININ.Addins.IC.Interactions.attributeNames.interactionType
    ]
});

Members

attributes :object

Read-only Since 2016 R1 API Version 1

The watched attributes of the interaction.

interactionId :string

Read-only Since 2016 R1 API Version 1

The identifier of the interaction.

Methods

getAttribute(attributeName) :String

Implements ININ.Addins.IC.Interactions.IInteraction#getAttribute

Since 2016 R1 API Version 1

Returns the value of the attribute specified, treating the attribute name case-insensitively.

Parameters

Name Type Description
attributeName String

The name of the attribute. This is treated case-insensitively. Can be one of the common attribute names from ININ.Addins.IC.Interactions.attributeNames.

Returns

The value of the attribute, if it is cached in this instance.

Type
String

subscribe(request) :IPromise

Implements ININ.Addins.IC.ISubscription#subscribe

Async Since 2016 R1 API Version 1

Creates or updates the subscription to the specified interaction and the specified associated attributes.

The application must be connected to Interaction Center. Callers can verify the connection by inspecting the ININ.Addins.IC.sessionInfo object.

Parameters

Name Type Description
request ININ.Addins.IC.Interactions.IWatchedInteractionSubscribeRequest

The request.

Returns

A promise to the subscription being created or updated.

Type
IPromise

unsubscribe() :IPromise

Implements ININ.Addins.IC.ISubscription#unsubscribe

Async Since 2016 R1 API Version 1

Deletes the subscription to the specified interaction.

Returns

A promise to the subscription being deleted.

Type
IPromise

Events

attributesChanged

Since 2016 R1 API Version 1

The watched interaction's attributes has changed.

Parameters

Name Type Description
watchedInteraction ININ.Addins.IC.Interactions.WatchedInteraction

The ININ.Addins.IC.Interactions.WatchedInteraction instance.

deallocated

Since 2016 R1 API Version 1

The watched interaction has been deallocated.

Parameters

Name Type Description
watchedInteraction ININ.Addins.IC.Interactions.WatchedInteraction

The ININ.Addins.IC.Interactions.WatchedInteraction instance.

gone

Since 2016 R1 API Version 1

The watched interaction has been can no longer be watched due to deallocation or the user lost rights to it.

When this event is raised, the subscription is automatically unsubscribed.

Parameters

Name Type Description
watchedInteraction ININ.Addins.IC.Interactions.WatchedInteraction

The ININ.Addins.IC.Interactions.WatchedInteraction instance.

lostRights

Since 2016 R1 API Version 1

The user has lost rights to the watched interaction.

Parameters

Name Type Description
watchedInteraction ININ.Addins.IC.Interactions.WatchedInteraction

The ININ.Addins.IC.Interactions.WatchedInteraction instance.

morphed

Since 2016 R1 API Version 1

The watched interaction has morphed.

Parameters

Name Type Description
morphedInteraction ININ.Addins.IC.Interactions.IMorphedInteractionEvent

The ININ.Addins.IC.Interactions.IMorphedInteractionEvent instance.

watchedInteraction ININ.Addins.IC.Interactions.WatchedInteraction

The ININ.Addins.IC.Interactions.WatchedInteraction instance.