Author Topic: retreive skill usage  (Read 2727 times)

Offline DANIEL.DOUSSET

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
retreive skill usage
« on: October 04, 2021, 08:35:45 AM »
Hi,

I'm trying to developp a program to find whose person use a skill  and the level. 

I scan all person and skill but it's very long. So,  I would like to do as CME with the Dependency TAB of a specific Skill. It is possible ?

I developp whith PSDK 8.5 java.

Thank you

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: retreive skill usage
« Reply #1 on: October 04, 2021, 05:12:22 PM »
Maybe do that Query and check on CfgServer logs what it requests exactly, you will see the Event and XML interpretation.
Then replicate via PSDK
However there you still will need to scan evey single agent on the platform...same thing you are doing now

Offline hsujdik

  • Hero Member
  • *****
  • Posts: 541
  • Karma: 30
Re: retreive skill usage
« Reply #2 on: October 04, 2021, 05:27:54 PM »
Does it have to be retrieved through PSDK, or can you connect to the Config Database? Because if you can, it is way faster to retrieve something like:

select
p.dbid as person_dbid,
p.employee_id,
p.user_name,
s.dbid as skill_dbid,
s.name as skill_name,
sl.level_ as skill_level
from cfg_person p
inner join cfg_skill_level sl on sl.person_dbid = p.dbid
inner join cfg_skill s on s.dbid = sl.skill_dbid
where
s.name = 'SKILL_NAME_TO_VERIFY'

Offline Janis

  • Full Member
  • ***
  • Posts: 123
  • Karma: 4
Re: retreive skill usage
« Reply #3 on: October 04, 2021, 06:32:32 PM »
Looks like we can do this (replace 106 with the dbid of your skill):

[code]CfgXPathBasedQuery query = new CfgXPathBasedQuery(confService, CfgObjectType.CFGPerson, "CfgPerson[skillLevels/*/@linkDBID = 106]");
ICollection<CfgPerson> persons = confService.RetrieveMultipleObjects<CfgPerson>(query);[/code]


"CfgPerson[skillLevels/*/@linkDBID = 106]" - found in confserv log after checking dependency for the skill in the CME. Don't know details of it.
« Last Edit: October 04, 2021, 06:39:38 PM by Janis »

Offline Janis

  • Full Member
  • ***
  • Posts: 123
  • Karma: 4
Re: retreive skill usage
« Reply #4 on: October 04, 2021, 06:34:16 PM »
https://stackoverflow.com/questions/45067040/use-iconfservice-to-query-object-by-attributes

Offline DANIEL.DOUSSET

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: retreive skill usage
« Reply #5 on: October 05, 2021, 07:39:47 AM »
Thank you for the solution.

I use the JANIS Code. It's perfect. I win lot's of time Thank you. Now i think i go to look in the configserver log.  I allaways try to look but i doesnt know how to you that in my code. Now i know.

GOODDDDD