Genesys CTI User Forum > Genesys-related Development

Genesys IWS - custom outbound update

<< < (2/3) > >>

Kubig:
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.

obegendi:
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.

Kubig:
Ok, I will try it as well today. Let us know, if you find out anything.. I will do the same :-)

abudwill:
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]

smile:
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.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version