Author Topic: Retrieving List of Skills using a Filter  (Read 2794 times)

Offline gravnook

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Retrieving List of Skills using a Filter
« on: November 14, 2017, 01:25:22 PM »
Hi,

I'm developing an application that will allow Supervisors to create Agents from a Web Front-End. I'm currently trying to figure out how to present a list of available Skills for them to select, depending upon which Business Group the Agent will be associated with. Each Business Group has a different set of skills, so I want my filter to look something like:

Key = "ObjectPath"
Value = "Starts With \\Configuration\\Environment\\<Name_Of_Business_Group>"

Can someone please show me how to add a path-based filter such as this to my CfgSkillQuery object?

Thanks

Offline water235

  • Newbie
  • *
  • Posts: 47
  • Karma: 0
Re: Retrieving List of Skills using a Filter
« Reply #1 on: November 14, 2017, 04:30:04 PM »
so, i m not totally positive on this - but you could try this,
Add something to Annex Tab of the skill -  LOB as a section or key and a value,
this information then will be available in flex prop - you could use the two tables and get a filter !

skill a - (annex lob a)
skill b - (annex lob b)
skill c - (annex lob c)
skill d - (annex lob a)
skill e - (annex lob c)
...

Thanks,
Water

Offline RobertH

  • Jr. Member
  • **
  • Posts: 69
  • Karma: 1
Re: Retrieving List of Skills using a Filter
« Reply #2 on: January 15, 2018, 05:43:38 PM »
Reading skills based on name in filter can be done like this. But I don't think you want this. or skill name will be name of business group supervisor belongs to?

private ConfServerProtocol confProtocol;

public void readSkillsLowLevel() {

KeyValueCollection filterKey = new KeyValueCollection();
filterKey.addObject("name", "<Skill-Name>");

CfgObjectType objectType = CfgObjectType.CFGSkill;
int intSkill = objectType.asInteger();
RequestReadObjects requestReadObjects = RequestReadObjects.create(intSkill, filterKey);

try {
confProtocol.send(requestReadObjects);
} catch (ProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

Offline PeteHoyle

  • Full Member
  • ***
  • Posts: 126
  • Karma: 13
Re: Retrieving List of Skills using a Filter
« Reply #3 on: January 16, 2018, 11:11:35 AM »
Hi,

Maybe there is a better way to find all the skills within a BusinessUnit, but here is some code i put together quickly.

It retrieves all folders with a type of '13' which are skill folders, it then iterates through the returned folders and tries to match the path the to a BusinessUnit, once it has found all matches it then retrieves the skills within those folders.

The sample code uses the COM Application Block..

[code]                List<int> skillFolderDBIDs = new List<int>();
                string path_to_businessUnit = "\\Configuration\\Environment\\TestConfigUnit";
                //Get all folders for skills (Type 13)
                CfgFolderQuery queryFolder = new CfgFolderQuery(confService);
                queryFolder.Type = 13;
                var folders = queryFolder.Execute();
                foreach (CfgFolder folder in folders)
                {
                    string s = folder.ParentID.ToString();
                    if (folder.ObjectPath.StartsWith(path_to_businessUnit))
                    {
                        //This is our Skills Folder in the BusinessUnit, add the DBID to our list
                        skillFolderDBIDs.Add(folder.DBID);
                    }
                }

                //Work through our list of skill folders and get the skills in those folders
                foreach (int folder_dbid in skillFolderDBIDs)
                {
                    CfgSkillQuery querySkill = new CfgSkillQuery(confService);
                    querySkill["folder_dbid"] = folder_dbid;
                    var skills = querySkill.Execute();
                    foreach (CfgSkill skill in skills)
                    {
                        log.Debug("Skill: " + skill.Name);
                    }
                }[/code]

Offline RobertH

  • Jr. Member
  • **
  • Posts: 69
  • Karma: 1
Re: Retrieving List of Skills using a Filter
« Reply #4 on: January 16, 2018, 01:52:59 PM »
Yes you are right Pete, there is other way to do it. From the question in article is not clear how one can get list of skills to read.
Or better said, it was not clear for me :-D

Odoslané z D5803 pomocou Tapatalku