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
The watched attributes of the interaction.
interactionId :string
The identifier of the interaction.
Methods
getAttribute(attributeName) :String
Implements ININ.Addins.IC.Interactions.IInteraction#getAttribute
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 |
Returns
The value of the attribute, if it is cached in this instance.
- Type
- String
subscribe(request) :IPromise
Implements ININ.Addins.IC.ISubscription#subscribe
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
Deletes the subscription to the specified interaction.
Returns
A promise to the subscription being deleted.
- Type
- IPromise
Events
attributesChanged
The watched interaction's attributes has changed.
Parameters
Name | Type | Description |
---|---|---|
watchedInteraction | ININ.Addins.IC.Interactions.WatchedInteraction |
The |
deallocated
The watched interaction has been deallocated.
Parameters
Name | Type | Description |
---|---|---|
watchedInteraction | ININ.Addins.IC.Interactions.WatchedInteraction |
The |
gone
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 |
lostRights
The user has lost rights to the watched interaction.
Parameters
Name | Type | Description |
---|---|---|
watchedInteraction | ININ.Addins.IC.Interactions.WatchedInteraction |
The |
morphed
The watched interaction has morphed.
Parameters
Name | Type | Description |
---|---|---|
morphedInteraction | ININ.Addins.IC.Interactions.IMorphedInteractionEvent |
The |
watchedInteraction | ININ.Addins.IC.Interactions.WatchedInteraction |
The |