Genesys CTI User Forum > Genesys-related Development
required code for retrieving a particular agent access group using SDK.
PeteHoyle:
[quote author=Naveen Kancharla link=topic=9579.msg43270#msg43270 date=1462856487]
thanx PeteHoyle it help me alot, but i need little more help.
While execute the code it shows list of all user having access to mentioned access group.if suppose i want a particular user from the list what will be the code for it.
[/quote]
Hi,
Can you explain a bit more about what you are trying to do, there is an example above of how to get the AccessGroups for a particular User.
Pete.
Naveen Kancharla:
code o/p:
CfgObject type = Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgAccessGroup
properties : { groupInfo : CfgObject type = Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgGroup properties : { DBID : 262 tenantDBID : 1 name : GAX EZPulse managerDBIDs : A collection of DBIDs = NULL routeDNDBIDs : A collection of DBIDs = NULL capacityTableDBID : 0 quotaTableDBID : 0 state : 1 userProperties : KVList: capacityRuleDBID : 0 siteDBID : 0 contractDBID : 0 }
memberIDs : A list of structures (Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgID) length = 16 { CfgObject type = Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgID
properties : { CSID : 0 DBID : 102 type : 3 }
CfgObject type = Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgID
properties : { CSID : 0 DBID : 731 type : 3 }
CfgObject type = Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgID
properties : { CSID : 0 DBID : 732 type : 3 }
you can see that multiple user are their in output. so, how can i retrieve particular user from the list.
PeteHoyle:
[quote author=Naveen Kancharla link=topic=9579.msg43294#msg43294 date=1462943217]
code o/p:
CfgObject type = Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgAccessGroup
properties : { groupInfo : CfgObject type = Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgGroup properties : { DBID : 262 tenantDBID : 1 name : GAX EZPulse managerDBIDs : A collection of DBIDs = NULL routeDNDBIDs : A collection of DBIDs = NULL capacityTableDBID : 0 quotaTableDBID : 0 state : 1 userProperties : KVList: capacityRuleDBID : 0 siteDBID : 0 contractDBID : 0 }
memberIDs : A list of structures (Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgID) length = 16 { CfgObject type = Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgID
properties : { CSID : 0 DBID : 102 type : 3 }
CfgObject type = Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgID
properties : { CSID : 0 DBID : 731 type : 3 }
CfgObject type = Genesyslab.Platform.ApplicationBlocks.ConfigurationObjectModel.CfgObjects.CfgID
properties : { CSID : 0 DBID : 732 type : 3 }
you can see that multiple user are their in output. so, how can i retrieve particular user from the list.
[/quote]
So you could iterate through the MemberIds until you find the DBID of the Agent you want to check, or you could use this query which gets the Access Groups that an Agent belongs to and then look for a match on the Access Group Name
[code] CfgAccessGroupQuery query = new CfgAccessGroupQuery();
query.PersonDbid = 731;
query.TenantDbid = 1;
ICollection<CfgAccessGroup> accessGroups = confService.RetrieveMultipleObjects<CfgAccessGroup>(query);
foreach (CfgAccessGroup accessGroup in accessGroups)
{
log.Debug(accessGroup.GroupInfo.Name);
if(accessGroup.GroupInfo.Name == "GAX EZPulse")
{
log.Debug("Agent is a Member of GAX EZPulse");
}
}[/code]
Naveen Kancharla:
thanx a lot!!!!!
abou:
Hello,
i have a problem to get list of all accessroup :
[code]try
{
var accessGroupQuery = new CfgAccessGroupQuery
{
// TenantDbid = Int32.Parse(tenantDBID),
TenantDbid = 101,
};
ICollection<CfgAccessGroup> accessGroupList =
CsProxyAccessor.Instance.RetrieveMultipleObjects<CfgAccessGroup>(accessGroupQuery);
foreach(CfgAccessGroup accessGroup in accessGroupList)
{
sb.Append(GisInteroperability.ToGisXML(accessGroup.ToXml().ToXmlNode().OuterXml, "CfgAccessGroup", string.Empty)); //read the XML and test it
}
[/code]
the accessgrouplist contain elements but not exactly a collection of <CFgAccessGroup>
screenshot (bottom)
[url=https://drive.google.com/file/d/0B4atrkOwAJq5U0lWcUYtRUJ3aTQ/view?usp=sharing]https://drive.google.com/file/d/0B4atrkOwAJq5U0lWcUYtRUJ3aTQ/view?usp=sharing[/url]
Navigation
[0] Message Index
[*] Previous page
Go to full version