Author Topic: Updating the Options of genesys application using Genesys SDK  (Read 3593 times)

Offline genesyslearner

  • Jr. Member
  • **
  • Posts: 58
  • Karma: 0
Updating the Options of genesys application using Genesys SDK
« on: January 04, 2018, 07:11:49 PM »
Hi All,

I am new to Genesys SDK and i want to learn on how to make a Java code to update the Options of an application through genesys SDK.
I have already written a code to establish the connection with Configuration Server but I am not sure on how to Update the Options of an application.

It would be a great help if I could get a pointer to class and method which I can use to update the options of any application using Genesys SDK.

Offline RobertH

  • Jr. Member
  • **
  • Posts: 69
  • Karma: 1
Re: Updating the Options of genesys application using Genesys SDK
« Reply #1 on: January 04, 2018, 08:16:11 PM »
[quote author=genesyslearner link=topic=10815.msg49163#msg49163 date=1515093109]
Hi All,

I am new to Genesys SDK and i want to learn on how to make a Java code to update the Options of an application through genesys SDK.
I have already written a code to establish the connection with Configuration Server but I am not sure on how to Update the Options of an application.

It would be a great help if I could get a pointer to class and method which I can use to update the options of any application using Genesys SDK.
[/quote]
Did you checked samples released with psdk? Isn't such basic example there?

Odoslané z D5803 pomocou Tapatalku


Offline abudwill

  • Full Member
  • ***
  • Posts: 157
  • Karma: 4
Re: Updating the Options of genesys application using Genesys SDK
« Reply #2 on: January 05, 2018, 01:28:52 AM »
Use CfgApplicationQuery to obtain the application you are interested in. Example the APIs for CfgApplication to see how to access the options. After modifying them you can call the Save method to save any changes you made. If you search the board for CfgApplicationQuery you should find some examples.

Offline genesyslearner

  • Jr. Member
  • **
  • Posts: 58
  • Karma: 0
r Re: Updating the Options of genesys application using Genesys SDK
« Reply #3 on: January 08, 2018, 08:41:29 AM »
Thanks RobertH for you reply but there isn't any example provided in PSDK examples 9.0.

Hi abudwill,

Thanks for the reference to classes. I am able to give the name of Application i want to update using CfgApplicationQuery but there are no examples of CfgApplication on how to access the options.
Could you please guide me to the URL where there are some examples on the same?

Offline genesyslearner

  • Jr. Member
  • **
  • Posts: 58
  • Karma: 0
Re: Updating the Options of genesys application using Genesys SDK
« Reply #4 on: January 09, 2018, 01:13:07 PM »
Hi folks,

I am struggling to update the Options of an application using Delta objects. I have set the new value for a application using key Value collection class object but now as i need to update the options i have to use the method "update(ICfgDelta deltaObject)" of cfgapplication.

Could you please suggest the way to pass the KeyValueCollection object as delta object?




Offline PeteHoyle

  • Full Member
  • ***
  • Posts: 126
  • Karma: 13
Re: Updating the Options of genesys application using Genesys SDK
« Reply #5 on: January 15, 2018, 01:27:14 PM »
Hi,

Here is some sample code that demonstrates how to update the option of an application using the COM Application Block, you just add error handling etc..:

[code]                var applicQuery = new CfgApplicationQuery { Name = "InteractionWorkspace_ATOS" };
                CfgApplication application = confService.RetrieveObject<CfgApplication>(applicQuery);

                Console.WriteLine(application.Name);
                KeyValueCollection kvcOptions = application.Options;

                if (kvcOptions != null)
                {
                    //Check for Section called 'Test'
                    if (kvcOptions.ContainsKey("Test"))
                    {
                        KeyValueCollection test = kvcOptions.GetAsKeyValueCollection("Test");
                        if (test != null)
                        {
                            //Check for Option called 'Option1'
                            if (test.ContainsKey("Option1"))
                            {
                                //Set new value if we have it
                                test["Option1"] = DateTime.UtcNow.ToString();
                            }
                            else
                            {
                                //Add it if we don't
                                test.Add("Option1", DateTime.UtcNow.ToString());
                            }
                        }
                       
                    }
                    else
                    {
                        //Create enw section called 'Test' and add option called 'Option1'.
                        KeyValueCollection Option1 = new KeyValueCollection();
                        Option1.Add("Option1", DateTime.UtcNow.ToString());
                        kvcOptions.Add("Test", Option1);
                    }
                }
                application.Save();[/code]

Offline genesyslearner

  • Jr. Member
  • **
  • Posts: 58
  • Karma: 0
Re: Updating the Options of genesys application using Genesys SDK
« Reply #6 on: January 17, 2018, 02:19:18 PM »
Thanks PeteHole. the code helped me through to update the options field.