Author Topic: Genesys IWS - custom outbound update  (Read 8918 times)

Offline obegendi

  • Newbie
  • *
  • Posts: 12
  • Karma: 0
Genesys IWS - custom outbound update
« on: December 19, 2014, 12:17:45 PM »
Hello everyone,

I'm trying to do something that i dont have a clue. I customized my own region like a form. I have campaign and calling lists. How can i update or add a record to one of my lists ?

I tried to connect outbound contact server and i did it. Then, tried to request load-unload campaign and i did. I used Genesyslab.Platform.Outbound.Protocols.OutboundServer.Requests , so i didnt see like requestupdaterecord something like that. How can i do this, can anyone tell me ?

Also another question, is this the right way to open connection to Outbound Contact Server in iws, i think its already bound to it, how can use this connection with iws own sdk ?

Thank you

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Genesys IWS - custom outbound update
« Reply #1 on: December 22, 2014, 10:56:53 AM »
Check assembly Genesyslab.Desktop.Modules.Outbound

It is not necessary to use PSDK in this case, just IWS API/SDK.

Offline obegendi

  • Newbie
  • *
  • Posts: 12
  • Karma: 0
Re: Genesys IWS - custom outbound update
« Reply #2 on: December 22, 2014, 12:52:58 PM »
yes, i check that but there is only few request like campaignstart,campaignstop; there is no request add or update calling list. how can i do that ?

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Genesys IWS - custom outbound update
« Reply #3 on: December 22, 2014, 01:00:26 PM »
And what about Genesyslab.Desktop.Modules.Outbound.Windows.OutboundRecord? there are several methods for achieve it. In other way, you have not to do it through SDK, but just through direct database commands.

Offline obegendi

  • Newbie
  • *
  • Posts: 12
  • Karma: 0
Re: Genesys IWS - custom outbound update
« Reply #4 on: December 22, 2014, 01:11:39 PM »
container.RegisterInstance<Genesyslab.Desktop.Modules.Outbound.Windows.OutboundRecord.OutboundRecordViewModel>(iout);

iout.OutboundRecord.UserData.Add("Duration", 10);

can this work like this way ? or do i need to create model and view like before i done ?

//IMySampleView my = container.Resolve<IMySampleView>();
            //container.RegisterInstance<IMySampleView>(my);

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Genesys IWS - custom outbound update
« Reply #5 on: December 22, 2014, 01:18:14 PM »
It is just a ViewModel (I assume that you know MVVM pattern) - so, you can create view and "implement" the model within this view, or just read the values from model into your variables,methods, etc. It is better to test it, because with each version of IWS, the methods have been changed without any notification or change in method declaration (unfortunately). So, try to implement it and make some test, you will see more. I am not at my test lab yet, so cannot confirm it from my site.

Just note: for updating records you do not need any customization, it is possible by configuration of default by built-in function of IWS. For adding records there exists other tools like GA(GAX) or old OCM.

Offline obegendi

  • Newbie
  • *
  • Posts: 12
  • Karma: 0
Re: Genesys IWS - custom outbound update
« Reply #6 on: December 22, 2014, 01:51:01 PM »
unfortunately, my client insist to update data from my iws custom view. im gonna try what you said, i hope resolve my problem. thank you.

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Genesys IWS - custom outbound update
« Reply #7 on: December 22, 2014, 01:53:25 PM »
Ok, I will try it as well today. Let us know, if you find out anything.. I will do the same :-)

Offline abudwill

  • Full Member
  • ***
  • Posts: 157
  • Karma: 4
Re: Genesys IWS - custom outbound update
« Reply #8 on: December 22, 2014, 06:12:34 PM »
I believe IWS will only be able to update records that are in Retrieved state within OCS.  If records are in Ready state and therefore not in OCS memory, direct DB manipulation will be needed.

In my case, I have done direct DB manipulation successfully many times - to add/remove records, update records, etc (but again, ONLY if record is in Ready state).  Also it is probably bad design to connect directly to DB from IWS client desktop.  What I have done in the past is expose a web service that does the DB manipulation for me, then have IWS consume the web service.  In my opinion this is cleaner and I get centralized logging for troubleshooting purposes if needed.

For records in Retrieved state sitting on agent desktop, I do something like this:

[code]
        // method to update outbound record that is sitting on agent desktop
        public static Boolean UpdateRecord(IInteraction interaction, IAgent agentManager, String fieldName, String fieldValue)
        {
            Boolean retVal;

            try
            {
                IEnterpriseServiceProvider serviceProvider = agentManager.EntrepriseService.Provider;
                IOutboundService outboundService = serviceProvider.Resolve<IOutboundService>("outboundService");

                Genesyslab.Enterprise.Interaction.OutboundRecord dataRecord = default(Genesyslab.Enterprise.Interaction.OutboundRecord);
                Genesyslab.Enterprise.Model.Interaction.IChainRecord chainRecords = default(Genesyslab.Enterprise.Model.Interaction.IChainRecord);
                chainRecords = interaction.OutboundChainRecord;

                System.Collections.Generic.ICollection<Genesyslab.Enterprise.Model.Interaction.IRecord> collectionOfRecords = default(System.Collections.Generic.ICollection<Genesyslab.Enterprise.Model.Interaction.IRecord>);
                collectionOfRecords = chainRecords.Records;

                dataRecord = (OutboundRecord)collectionOfRecords.ElementAt(collectionOfRecords.Count - 1);

                System.Collections.Generic.Dictionary<string, object> customFields = new System.Collections.Generic.Dictionary<string, object>();

                customFields.Add(fieldName, fieldValue);
                dataRecord.CustomFields = customFields;

                Genesyslab.Enterprise.Commons.Collections.KeyValueCollection extension = new Genesyslab.Enterprise.Commons.Collections.KeyValueCollection();
                extension.Add("BusinessCall", 1);

                outboundService.UpdateRecord(agentManager.FirstMediaVoice.Device, dataRecord, extension, null);

                retVal = true;
            }
            catch (Exception)
            {
                retVal = false;
            }

            return retVal;
        }
[/code]

Offline smile

  • Sr. Member
  • ****
  • Posts: 286
  • Karma: 6
Re: Genesys IWS - custom outbound update
« Reply #9 on: December 23, 2014, 12:42:38 PM »
You can add new record to any list using OCS HTTP interface, check ref. guide. The sample is:

POST http://ocs.genesyslab.com:8080/lists/Alpha%20List?req=AddRecord HTTP/1.1
Host: ocs.genesyslab.com
User-Agent: Genesys Orchestration/8.0.000.15 ORS Strategy #1
Content-type: application/json
Content-length: 84
{
"GSW_CAMPAIGN_NAME":"Alpha Campaign",
"GSW_PHONE":"4155670000",
"GSW_TZ_NAME":"PST"
}

I don't know the way how to update existed record using this method, i guess this because of record should stay in OCS memory to be updated.

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Genesys IWS - custom outbound update
« Reply #10 on: December 23, 2014, 12:57:46 PM »
Smile is right - I totally forget to this option :) For update you can use this access as well as the documentation says:

[quote]A partial representation is needed when an update is requested for an
existing record and only updated fields can be delivered[/quote]

Offline obegendi

  • Newbie
  • *
  • Posts: 12
  • Karma: 0
Re: Genesys IWS - custom outbound update
« Reply #11 on: December 26, 2014, 10:30:26 AM »
actually i did. Outbound Ref. Manual said need to send gsw_req_type as key and recordprocessed as value. then i did it with this way. While agent After Call Back status, i can change anything on record(s).