Author Topic: Configuring and reading an agent specific Key/Value from WDE  (Read 2476 times)

Offline DeonsSGGU

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Configuring and reading an agent specific Key/Value from WDE
« on: February 15, 2017, 07:12:32 AM »
I need tag every agent with a value in the configuration. Example: AgentType = "Home" or "Work".
I then need to read the AgentType value for the specific logged in agent in a WDE custom module.

Can someone perhaps give some advice on:
- Where would I store this in the Genesys config?
- How do I read the value for the specific logged in agent from the WDE code?

I can easily read the application wide configuration but the problem is reading agent specific values.

Thanks
« Last Edit: February 15, 2017, 07:14:52 AM by DeonsSGGU »

Offline daniel_san

  • Jr. Member
  • **
  • Posts: 84
  • Karma: 1
Re: Configuring and reading an agent specific Key/Value from WDE
« Reply #1 on: February 15, 2017, 11:31:53 AM »
Using IAgent you can easily access to whatever value on your agent.

You can use container to resolve it.

"IAgent agent = container.resolve("IAgent")" ; not exactly...

inside agent you can access to userproperties and options.

Or resolve it in the constructor.

Regards.

Offline abudwill

  • Full Member
  • ***
  • Posts: 157
  • Karma: 4
Re: Configuring and reading an agent specific Key/Value from WDE
« Reply #2 on: February 15, 2017, 06:33:59 PM »
As daniel_san suggests, look at documentation are IAgent.

I have done this many times (reading options from the WDE app object used to log in) with the following:

[code]            IConfigurationService configService = container.Resolve<IConfigurationService>();
            CfgApplication app = configService.MyApplication;
            Genesyslab.Platform.Commons.Collections.KeyValueCollection annex = app.UserProperties;[/code]

I believe IAgent can be used in a similar way as above.

Offline DeonsSGGU

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: Configuring and reading an agent specific Key/Value from WDE
« Reply #3 on: February 16, 2017, 05:59:20 AM »
Thank you very much for both replies.

I will try both options today.