Genesys Engage on-premises

 View Only
Discussion Thread View

WDE Customization, working with OCS for get a specific record

  • 1.  WDE Customization, working with OCS for get a specific record

    Posted 04-14-2022 09:48
    Hi,

    I am currently working on a subject, concerning WDE customization, in order to be able to recover a record from a recall campaign.

    I manage to work with the records of the ocs, however I would like to be able to request a specific recall from the OCS.

    In my case the developer has a link (WebService) linked to the OCS database, allowing to obtain the list of pending reminders for a specific campaign.

    I want from this information (record_id or chain_id) to display to the agent the callback he requested via the new interface (a simple table listing the pending callbacks) like a classic callback, but this time only get the one wanted , not the first in the OCS list

    I try this, but the code does not work, it fail because the var "records" is not set (null) by "GetChainRecordsByCampaignName" :

    I don't have any other solution, do you have any idea ?
                    CallingListModel recordSelected = e.Result as CallingListModel;
                    //Envoie de la commande pour get le prochain record
                    ICampaignService service = CustomModule.EnterpriseServiceProvider.Resolve<ICampaignService>("campaignService");
                    IOutboundService outbound = CustomModule.EnterpriseServiceProvider.Resolve<IOutboundService>("outboundService");
                    ICampaign campaignCiel2 = service.GetAllCampaigns().First(m => m.Value.Name.Contains(CAMPAIGN_NAME)).Value;
                    //outbound.GetChainRecordsByCampaignName
                    //service = service.GetPreviewRecord(campaignCiel2, null);
                    aLog.Debug("campagne name record : " + campaignCiel2.Name);
                    var records = outbound.GetChainRecordsByCampaignName(campaignCiel2.Name);
                    aLog.Debug("liste record : " + records.Length);
    
                    foreach (IChainRecord chain in records)
                    {
                        aLog.Debug("IChainRecord : " + chain.InteractionID);
                        aLog.Debug("IChainRecord : " + chain.Device.FQName);
                        aLog.Debug("IChainRecord : " + chain.Device.Name);
                        IRecord record = chain.Records.ToList().Find(m => m.RecordID == recordSelected.RecordId);
                        if(record != null)
                        {
                            aLog.Debug("IRecord " + record.AgentID);
                            aLog.Debug("IRecord " + record.PhoneNumber);
                            outbound.GetChainedRecords(chain.Device, record, new Genesyslab.Enterprise.Commons.Collections.KeyValueCollection(), "");
                        }
                    }​


    Thanks in advance,

    Best regards

    Quentin


    #GenesysEngageDev

    ------------------------------
    Quentin Airey
    NXO FRANCE SASU
    ------------------------------