Genesys CTI User Forum

Genesys CTI User Forum => Genesys-related Development => Topic started by: DeonsSGGU on February 15, 2017, 07:12:32 AM

Title: Configuring and reading an agent specific Key/Value from WDE
Post by: DeonsSGGU 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
Title: Re: Configuring and reading an agent specific Key/Value from WDE
Post by: daniel_san 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.
Title: Re: Configuring and reading an agent specific Key/Value from WDE
Post by: abudwill 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.
Title: Re: Configuring and reading an agent specific Key/Value from WDE
Post by: DeonsSGGU on February 16, 2017, 05:59:20 AM
Thank you very much for both replies.

I will try both options today.