2014-12-02 103 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