Hi Jerome,
I did a test.
I used the following code, more or less copied from documentation, but with one correction: Namespace of interaction is
ININ.Addins.IC.Interaction
snot
ININ.Addins.IC.Interaction
Notice the missing "s"
<script>
var queue;
function apiLoaded() {
var versionString = "I am running version " + ININ.Addins.version + " of the add-in API.";
document.getElementById("version").innerText = versionString;
// Observe when the application is connected
ININ.Addins.IC.sessionInfo.on("connected", function(sessionInfo) {
console.log(sessionInfo.userId + " is connected to " + sessionInfo.icServer);
subscribeQueue();
});
// Determine whether the application is connected
if (ININ.Addins.IC.sessionInfo.connected) {
console.log("Application is connected");
subscribeQueue();
}
}
function subscribeQueue() {
queue = new ININ.Addins.IC.Queues.Queue();
queue.on("interactionAdded", function(interaction) {
console.log(
interaction.getAttribute(ININ.Addins.IC.Interactions.attributeNames.interactionType),
"Interaction", interaction.interactionId, "was added to queue. State is:",
interaction.getAttribute(ININ.Addins.IC.Interactions.attributeNames.stateDisplay)
);
});
queue.on("interactionChanged", function(interaction) {
console.log(
interaction.getAttribute(ININ.Addins.IC.Interactions.attributeNames.interactionType),
"Interaction", interaction.interactionId, "has changed. State is:",
interaction.getAttribute(ININ.Addins.IC.Interactions.attributeNames.stateDisplay)
);
});
queue.on("interactionRemoved", function(interaction) {
console.log("Interaction", interaction.interactionId, "has been removed from queue.");
});
queue.subscribe({
attributeNames: [
ININ.Addins.IC.Interactions.attributeNames.interactionType,
ININ.Addins.IC.Interactions.attributeNames.stateDisplay
],
queueIds: [
{ type: ININ.Addins.IC.Queues.queueTypes.system, name: ININ.Addins.IC.sessionInfo.userId }
]
});
</script>
This code gives the following console output for two calls without any reload or refresh of the addin or the client
(Sorry, state values are in German because we have a german system)
Call Interaction 2001580215 was added to queue. State is: Initialisierung wird durchgeführt
Call Interaction 2001580215 has changed. State is: Wählen
Call Interaction 2001580215 has changed. State is: Fortgesetzt
Call Interaction 2001580215 has changed. State is: Verbunden
Call Interaction 2001580215 has changed. State is: Getrennt [Fern getrennt]
Interaction 2001580215 has been removed from queue.
Call Interaction 2001580218 was added to queue. State is: Initialisierung wird durchgeführt
Call Interaction 2001580218 has changed. State is: Wählen
Call Interaction 2001580218 has changed. State is: Fortgesetzt
Call Interaction 2001580218 has changed. State is: Verbunden
Call Interaction 2001580218 has changed. State is: Getrennt [Fern getrennt]
Interaction 2001580218 has been removed from queue.
I hope this will help.
Best regards,
------------------------------
---------------------------------------------
Hans-Gerd Sandhagen
Software Developer
Fiebig GmbH
---------------------------------------------
------------------------------
Original Message:
Sent: 09-11-2020 04:22
From: Franz Jerome De Guzman
Subject: Interaction Connect add-in : Retrieving attribute, Queue Object and Session
Hi Hans,
We managed to get the attribute successfully using the existing code.
How do we get the new interaction if the previous call has already finished?
Existing code does not trigger without reloading the page add-in
Kind regards,
------------------------------
Franz Jerome De Guzman
Nexus Technologies, Inc.
Original Message:
Sent: 09-09-2020 10:42
From: Hans-Gerd Sandhagen
Subject: Interaction Connect add-in : Retrieving attribute, Queue Object and Session
Hi Jerome,
normally this should work. I could not test this at the moment but when I remember right there are some scenario to mention:
1. Interaction is already in queue, queue is subscribed by Addin -> queue send "interactionAdded" for all interactions in queue.
2. queue is subscribed by Addin, new interaction enters the queue -> queue send "interactionAdded" for this interactions.
3. Subscribed attribute is changed when interaction is in queue and queue is subscribed -> "interactionChanged" event is send.
Best regards,
------------------------------
---------------------------------------------
Hans-Gerd Sandhagen
Software Developer
Fiebig GmbH
Original Message:
Sent: 09-09-2020 02:38
From: Franz Jerome De Guzman
Subject: Interaction Connect add-in : Retrieving attribute, Queue Object and Session
Hi Hans,
We managed to get it working by adding the custom attribute at the queue.subscribe.
We are having issues on getting the new interaction with the same code, we need to reload the add-in to be able to get the new interaction.
We are assuming that queue.on("interactionChanged", function(interaction) should trigger at this change event.
Kind regards,
------------------------------
Franz Jerome De Guzman
Nexus Technologies, Inc.
Original Message:
Sent: 09-08-2020 04:29
From: Hans-Gerd Sandhagen
Subject: Interaction Connect add-in : Retrieving attribute, Queue Object and Session
Hi Jerome,
> Can we get this using getattribute function?
yes, this should work, but I am not sure, wether you have to subscribe for this attribute before or not.
Example:
....
attributeNames: [
"Attr_Shandle",
ININ.Addins.IC.Interactions.attributeNames.interactionType
]
.....
Best regards,
------------------------------
---------------------------------------------
Hans-Gerd Sandhagen
Software Developer
Fiebig GmbH
Original Message:
Sent: 09-08-2020 04:06
From: Franz Jerome De Guzman
Subject: Interaction Connect add-in : Retrieving attribute, Queue Object and Session
Hi Hans,
We managed to get the queue running.
We are trying to get the value of a custom attribute from a handler.
Can we get this using getattribute function?
this is the line of code we try to call and get the value - customAttribute = interaction.getAttribute("Attr_Shandle");
$(document).ready(function(){
var queue = new ININ.Addins.IC.Queues.Queue();
queue.on("interactionAdded", function(interaction) {
// console.log(
// interaction.getAttribute(ININ.Addins.IC.Interaction.attributeNames.interactionType),
// "Interaction", interaction.interactionId, "was added to queue. State is:",
// ININ.Addins.IC.Interaction.attributeNames.stateDisplay);
var interactionState = interaction.getAttribute(ININ.Addins.IC.Interactions.attributeNames.state),
customAttribute = interaction.getAttribute("Attr_Shandle");
});
queue.on("interactionChanged", function(interaction) {
console.log(
interaction.getAttribute(ININ.Addins.IC.Interaction.attributeNames.interactionType),
"Interaction", interaction.interactionId, "has changed. State is:",
ININ.Addins.IC.Interaction.attributeNames.stateDisplay
);
});
queue.on("interactionRemoved", function(interaction) {
console.log("Interaction", interaction.interactionId, "has been removed from queue.");
});
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
]
});
});
https://help.genesys.com/developer/cic/docs/connectaddin/ININ.Addins.IC.Interactions.html#.getAttributes
------------------------------
Franz Jerome De Guzman
Nexus Technologies, Inc.
Original Message:
Sent: 09-07-2020 05:31
From: Hans-Gerd Sandhagen
Subject: Interaction Connect add-in : Retrieving attribute, Queue Object and Session
Hi Jerome,
did you also subscribe to the queue (see example in the link you sent):
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 ]});
Best regards,
------------------------------
---------------------------------------------
Hans-Gerd Sandhagen
Software Developer
Fiebig GmbH
Original Message:
Sent: 09-07-2020 04:54
From: Franz Jerome De Guzman
Subject: Interaction Connect add-in : Retrieving attribute, Queue Object and Session
Hi Hans,
Confirmed that the api is loaded and sessionInfo is also saying connected.
Upon debugging I do not see any interactions caught during the queue even during a call.
Kind regards,
------------------------------
Franz Jerome De Guzman
Nexus Technologies, Inc.
Original Message:
Sent: 09-07-2020 02:05
From: Hans-Gerd Sandhagen
Subject: Interaction Connect add-in : Retrieving attribute, Queue Object and Session
Hi Jerome,
your code looks right, but there are two things to mention:
1. Please have a look at https://help.genesys.com/developer/cic/docs/connectaddin/tutorial-createcustview.html You should check, whether theAPI is already loaded.
2. There may be a timing problem when you check the connection state and then subscribe session info. I think better do it vice versa.
Best regards
------------------------------
---------------------------------------------
Hans-Gerd Sandhagen
Software Developer
Fiebig GmbH
Original Message:
Sent: 09-06-2020 21:59
From: Franz Jerome De Guzman
Subject: Interaction Connect add-in : Retrieving attribute, Queue Object and Session
Hi Paul,
Thank you so much for your reply.
The code is JavaScript
We are applying code found from this documentation
https://help.genesys.com/developer/cic/docs/connectaddin/inin.addins.ic.queues.queue.html
https://help.genesys.com/developer/cic/docs/connectaddin/ININ.Addins.IC.html
Kind regards,
Jerome.
------------------------------
Franz Jerome De Guzman
Nexus Technologies, Inc.
Original Message:
Sent: 09-05-2020 12:13
From: Paul Simpson
Subject: Interaction Connect add-in : Retrieving attribute, Queue Object and Session
Hey, Jerome!
Please can you clarify? You are saying you are using a Handler, but the code you post looks like C#, which would imply ICELib (or more specifically, an Interaction Desktop Add-In.)
------------------------------
Paul Simpson
Senior Technical Instructor
Original Message:
Sent: 09-04-2020 06:16
From: Franz Jerome De Guzman
Subject: Interaction Connect add-in : Retrieving attribute, Queue Object and Session
Hi there,
Need help please.
We are trying to get the attributes from a custom handler and we are using ININ.Addins.IC.
Prior to using the queue object we are validating the connection to the session and it shows as application not connected.
We are assuming that prior to using the queue object the session must be connected first.
Please help us and provide guidance please if our assumption is correct.
We have provided our script below
$(document).ready(function(){
if (!ININ.Addins.IC.sessionInfo.connected) {
console.log("Application is not connected");
}
// Observe when the application is connected
ININ.Addins.IC.sessionInfo.on("connected", function(sessionInfo) {
console.log(sessionInfo.userId + " is connected to " + sessionInfo.icServer);
});
var baseUrl = ININ.Addins.IC.getIcwsBaseUrl();
console.log(baseUrl);
var queue = new ININ.Addins.IC.Queues.Queue();
console.log("this is a queue instance created", queue);
queue.on("interactionAdded", function(interaction) {
console.log(
interaction.getAttribute(ININ.Addins.IC.Interaction.attributeNames.interactionType),
"Interaction", interaction.interactionId, "was added to queue. State is:",
ININ.Addins.IC.Interaction.attributeNames.stateDisplay
);
});
});
Kind regards,
Jerome
#Unsure/Other
------------------------------
Franz Jerome De Guzman
Nexus Technologies, Inc.
------------------------------