Genesys CTI User Forum

Genesys CTI User Forum => Genesys-related Development => Topic started by: gstkein on January 15, 2016, 12:37:17 PM

Title: PSDK query/search for Interaction Queues
Post by: gstkein on January 15, 2016, 12:37:17 PM
IWS allows users to search for Agents/Queues/Contacts in order to transfer an interaction.
It finds matches even if the user writes a partial name, like "Tre" will find "Trevor"

in order to find contacts, the query is something like

Type=Request
  Service=Index
  Method=Search
  Parameters=
    [
      Query="TenantId:1 AND (LastName:Tre* OR FirstName:Tre* OR PhoneNumber:Tre* OR EmailAddress:Tre* )"
      MaxResults=50
      tkv.multibytes="false"
      IndexName="contact"
    ]
  UserData=
    [
    ].


For agents it may use wildcards so

CfgPersonQuery query = new CfgPersonQuery();
query.setUserName("Tre*");
Object responseObject = confprotocol.requestMultiple(CfgPerson.class,query);


The question would be how does it find "Interaction Queue" objects?
Title: Re: PSDK query/search for Interaction Queues
Post by: Kubig on January 15, 2016, 12:49:29 PM
Interaction Queue is type of "script", so you should use CfgScriptQuery I guess.
Title: Re: PSDK query/search for Interaction Queues
Post by: gstkein on January 15, 2016, 01:36:23 PM
CfgScriptQuery Worked perfectly! Thanks Kubig!!!
Title: Re: PSDK query/search for Interaction Queues
Post by: gstkein on January 15, 2016, 01:56:57 PM
Would you know if there´s a way to make the query case insensitive?
Title: Re: PSDK query/search for Interaction Queues
Post by: gstkein on January 15, 2016, 03:10:27 PM
IWS seems to find the queues in a case insensitive way, and ConfigurationManager has a case insensitive checkbox in the search feature.

I could not find a way though, the API does not have that option apparenlty.

Anyway you´ve helped me a lot, so thank you.
Title: Re: PSDK query/search for Interaction Queues
Post by: abudwill on January 16, 2016, 12:27:00 AM
With some Cfg Server queries you can include filters that have KVPs.  There is a KVP of key: cmp_insensitive, value: 1 which will cause queries to be case insensitive.

I have used this in PSDK/.NET to do CfgPersonQuery's in a case insensitive manner.

Some details on a Genesys wiki around this (part of a javadoc): http://www.genesyslab.info/repository/PSDK/8.0-Java_API_Reference/com/genesyslab/platform/configuration/protocol/doc-files/Configuration%20Objects/config-objects-intro.html

Regards,
Andrew


Title: Re: PSDK query/search for Interaction Queues
Post by: gstkein on January 18, 2016, 02:48:58 PM
That´s great, thank you abudwill!
Title: Re: PSDK query/search for Interaction Queues
Post by: gstkein on January 18, 2016, 03:06:07 PM
So the final code would be:

                Set<CfgScript> queues = new HashSet<CfgScript>();
CfgScriptQuery  query = new CfgScriptQuery();
query.setName(prefix);
query.setScriptType(CfgScriptType.CFGInteractionQueue);
query.setProperty("cmp_insensitive", 1); // This sets the filter
Object responseObject = protocol.requestMultiple(CfgScript.class,query);