2014-12-02 105 views
1

我收到了一個任務,顯示Genesys IWS中來自web服務的外部事件的「新出站郵件」對話框。我將我的IWS擴展插入到位,並加載並提供Web服務界面。在Genesys Interaction工作區中打開新郵件交互窗口

我現在的主要問題是我不明白如何從代碼中打開交互窗口。我嘗試用得到它的一個實例:

IInteractionsWindow interactionsView = Container.Resolve<IInteractionsWindow>(); 
interactionsView.Create(); 
interactionsView.ShowView(); 

這實際上只有一半的作品,因爲我得到一個新的窗口,但它完全是空的。我是否需要自行加載每個區域?是否有一種更簡單的方式以完全整合的方式實現我的目標?

更新:我已經嘗試使用平臺SDK來實現,但我不知道這是否真的幫助我向代理顯示「新郵件」窗口。我試着用下面的代碼:

interactionServerProtocol = new InteractionServerProtocol(new Endpoint(new Uri("tcp://ixnServer:7319"))); 
interactionServerProtocol.ClientName = "CRMIntegrationModule"; 
interactionServerProtocol.ClientType = InteractionClient.AgentApplication; 

contactServerProtocol = new UniversalContactServerProtocol(new Endpoint(new Uri("tcp://ucsServer:5130"))); 
contactServerProtocol.ClientName = "CRMIntegrationModule"; 

interactionServerProtocol.Open(); 
contactServerProtocol.Open(); 

RequestSubmit request = RequestSubmit.Create(); 
request.InteractionType = "Outbound"; 
request.InteractionSubtype = "OutboundNew"; 
request.MediaType = "email"; 
request.Queue = "default"; 

EventAck response = interactionServerProtocol.Request(request) as EventAck; 
if (response != null) 
{ 
    string id = Convert.ToString(response.Extension["InteractionId"]); 

    RequestInsertInteraction insertRequest = RequestInsertInteraction.Create(); 
    insertRequest.InteractionAttributes = new InteractionAttributes 
    { 
     Id = id, 
     MediaTypeId = "email", 
     TypeId = "Outbound", 
     SubtypeId = "OutboundNew", 
     TenantId = 101, 
     Status = new NullableStatuses(Statuses.Pending), 
     Subject = "Testmail", 
     EntityTypeId = new NullableEntityTypes(EntityTypes.EmailOut) 
    }; 
    insertRequest.EntityAttributes = new EmailOutEntityAttributes() 
    { 
     FromAddress = "[email protected]", 
     ToAddresses = "[email protected]", 
    }; 
    insertRequest.InteractionContent = new InteractionContent() 
    { 
     Text = "This is the e-mail body." 
    }; 
    contactServerProtocol.Send(insertRequest); 

    RequestPlaceInQueue queueRequest = RequestPlaceInQueue.Create(); 
    queueRequest.InteractionId = id; 
    queueRequest.Queue = "default"; 
    interactionServerProtocol.Send(queueRequest); 
} 

interactionServerProtocol.Close(); 
contactServerProtocol.Close(); 

壞事是從交互服務器的響應是:

attr_ref_id [int] = 2 
attr_error_code [int] = 34 
attr_error_desc [str] = "Client is not logged in" 

我認爲這可能正確地莫名其妙地沒有被記錄有關,但我有沒有一個線索如何實現這一點。任何幫助?

UPDATE 2我可以使用Platform SDK發送電子郵件,但這不是我真正想要的。最初的問題仍然有效,因爲我只想調用交互窗口,就是這樣。其他的東西取決於用戶。可能嗎?

回答

0

我利用給定的命令鏈:

public IObjectContainer Container { get; set; } 

    public void NewItem(string contactId, string emailAddress) 
    { 
     IAgent agent = Container.Resolve<IAgent>(); 
     IRoutingBasedManager routingManager = Container.Resolve<IRoutingBasedManager>(); 

     IDictionary<string, object> parameters = new Dictionary<string, object>(); 
     parameters.Add("CommandParameter", agent.FirstMediaEmail); 
     parameters.Add("TargetId", contactId); 
     parameters.Add("OwnerId", agent.ConfPerson.EmailAddress); 
     parameters.Add("Destination", emailAddress); 
     parameters.Add("RecentIndex", contactId); 
     bool todo = routingManager.RequestToDo("CreateNewOutboundEmail", RoutingBasedTarget.Contact, parameters); 
     if (todo && parameters.ContainsKey("RoutingBaseCommand")) 
     { 
      IChainOfCommand chainOfCommand = parameters["RoutingBaseCommand"] as IChainOfCommand; 
      if (chainOfCommand != null) 
      { 
       chainOfCommand.Execute(parameters["RoutingBaseCommandParameters"]); 
      } 
     } 
    } 
0

您需要使用PlatformSDK。添加Genesyslab.platform.webmedia.protocols.dll 之後,您可以使用* webmedia.tserver.request,在該選項卡下有requestWeb或者某物。

channelService.RegisterEvents(tServerChannel, new Action<Genesyslab.Enterprise.Model.Channel.IClientChannel> 

在你的主模塊(有Initialize方法),需要註冊那樣。你可以放一個按鈕或者某物,然後你可以觸發事件,或者你可以在登錄後使用commandchain,由你決定。

祝你好運。

+0

感謝您的輸入。我也發現這個頁面http://docs.genesys.com/Documentation/PSDK/8.1.4/Developer/CreatinganE-Mail#t-1我不明白這是如何與IWS桌面客戶端應用程序一起工作的。 – Scoregraphic 2014-12-03 07:12:01

+0

我已經使用Platform SDK更新了我的新問題 – Scoregraphic 2014-12-03 13:35:23