Queue class

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

new Queue()

Implements ININ.Addins.IC.ISubscription

Represents a subscription to a queue and its interactions.

Example

var queue = new ININ.Addins.IC.Queues.Queue();
queue.on("interactionAdded", function(addedInteraction) {
    console.log("The ", addedInteraction.getAttribute(ININ.Addins.IC.Interactions.attributeNames.interactionType),
        "interaction with ID", addedInteraction.interactionId, "was added to the queue.");
});
queue.on("interactionChanged", function(changedInteraction) {
    console.log("The interaction with ID", changedInteraction.interactionId, "was changed.");
});
queue.on("interactionRemoved", function(removedEvent) {
    console.log("The interaction with ID", removedEvent.interactionId, "was removed.");
});
queue.subscribe({
    queueIds: [{
        type: ININ.Addins.IC.Queues.queueTypes.system,
        name: ININ.Addins.IC.sessionInfo.userId
    }],
    attributeNames: [
        "CUSTOM_ATTRIBUTE",
        ININ.Addins.IC.Interactions.attributeNames.interactionType
    ]
});

Members

interactions :ININ.Addins.IC.Interactions.IReadOnlyInteractionCollection

Read-only Since 2016 R1 API Version 1

The interactions that belong to the queue.

Methods

subscribe(request) :IPromise

Implements ININ.Addins.IC.ISubscription#subscribe

Async Since 2016 R1 API Version 1

Creates or updates the subscription to the specified queue.

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.Queues.IQueueSubscribeRequest

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 queue.

Returns

A promise to the subscription being deleted.

Type
IPromise

Events

changed

Since 2016 R1 API Version 1

The queue was changed.

Parameters

Name Type Description
queue ININ.Addins.IC.Queues.Queue

The ININ.Addins.IC.Queues.Queue instance.

interactionAdded

Since 2016 R1 API Version 1

The specified queue interaction was added.

Parameters

Name Type Description
interaction ININ.Addins.IC.Interactions.IInteraction

The interaction that was added.

queue ININ.Addins.IC.Queues.Queue

The ININ.Addins.IC.Queues.Queue instance.

interactionChanged

Since 2016 R1 API Version 1

The specified queue interaction was updated.

Parameters

Name Type Description
interaction ININ.Addins.IC.Interactions.IInteraction

The interaction that was updated.

queue ININ.Addins.IC.Queues.Queue

The ININ.Addins.IC.Queues.Queue instance.

interactionRemoved

Since 2016 R1 API Version 1

The specified queue interaction was removed.

Parameters

Name Type Description
removedInteraction ININ.Addins.IC.Queues.IQueueInteractionRemovedEvent

The interaction that was removed.

queue ININ.Addins.IC.Queues.Queue

The ININ.Addins.IC.Queues.Queue instance.