Author Topic: Handling button events "Done" window interaction  (Read 7727 times)

Offline GnomE

  • Newbie
  • *
  • Posts: 28
  • Karma: 0
Handling button events "Done" window interaction
« on: July 04, 2014, 11:32:53 AM »
Hello!
Tell me how to trace the pressing "Done" which completes an interaction? I need to do at the conclusion of the interaction record data in the database if they are filled, if not prohibit the user to close the window interaction.
[URL=http://fastpic.ru/view/64/2014/0704/dbf427084359250db5568fb216b98771.png.html][IMG]http://i64.fastpic.ru/thumb/2014/0704/71/dbf427084359250db5568fb216b98771.jpeg[/img][/URL]
I need trace the an event that would perform certain operations, right? I tried to listen to so
[code]viewEventManager.Subscribe(ActionEventHandler);

public void ActionEventHandler(object eventObject)
{
GenericEvent contactEvent = eventObject as GenericEvent;
}[/code]
but saw nothing associated with it. Making through the commands if I can operate with the form data, while in another class?

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Handling button events "Done" window interaction
« Reply #1 on: July 04, 2014, 12:06:07 PM »
I strongly recommend to you achieve that through commands.

Offline GnomE

  • Newbie
  • *
  • Posts: 28
  • Karma: 0
Re: Handling button events "Done" window interaction
« Reply #2 on: July 08, 2014, 11:50:43 AM »
I can not intercept this command. tell me whether correctly I am doing

so get an error at startup
[code]commandManager.CommandsByName["InteractionManagementMarkDone"].Insert(0, new CommandActivator() { CommandType = typeof(OnInteractionDone), Name = "MyInteractionDone" });[/code]

and so I do not come to your command by the debugger
[code]commandManager.InsertCommandToChainOfCommandBefore("InteractionManagementMarkDone", "MediaTypeMarkDone", new List<CommandActivator>() { new CommandActivator() { CommandType = typeof(OnInteractionDone) , Name="MyInteractionDone" } });[/code]

Tell me please, I can see the whole picture, how I could be in class command operate with form elements? Most of them are in the view model but not all.

Offline GnomE

  • Newbie
  • *
  • Posts: 28
  • Karma: 0
Re: Handling button events "Done" window interaction
« Reply #3 on: July 14, 2014, 05:21:42 AM »
friends, the question is relevant... help please  :-\

Offline abudwill

  • Full Member
  • ***
  • Posts: 157
  • Karma: 4
Re: Handling button events "Done" window interaction
« Reply #4 on: July 15, 2014, 08:51:49 PM »
Hi,

Kubig is correct.  You probably want to accomplish this by using IWS commands or command chains.

When various actions occur in IWS, a chain of commands is run.  The IWS APIs allow you to tack your own custom code onto command chains, or even create your own.

The documentation site explains this pretty well: http://docs.genesys.com/Documentation/IW/8.1.4/Developer/UseCustomizableCommands

In summary, you will:
[list]
[li]Identify the command chain you want to insert your custom actions on.  The documentation site lists them all under Reference for Commands.  Sometimes in order to figure out what command chain to add your functionality to, it is best to perform the action (like closing a case), then look in IWS logs to see what commands were fired[/li]
[li]Create a class representing your custom command, on the doc site reference CustomCommand.cs file - yours should look similar to this[/li]
[li]Register your custom command.  Doing this basically inserts your command into an existing command chain, the registration code might look something like this:[/li]

[/list][code]// File: ExtensionSampleModule.cs
ICommandManager commandManager = container.Resolve<ICommandManager>();
// Add a command before the release call
// Method 1:
commandManager.CommandsByName["InteractionVoiceReleaseCall"].Insert(0, new CommandActivator() {
    CommandType = typeof(BeforeReleaseCallCommand), Name = "BeforeReleaseCall" });
// Method 2 (recommended):
commandManager.InsertCommandToChainOfCommandBefore("InteractionVoiceReleaseCall", "ReleaseCall",
  new CommandActivator() { CommandType = typeof(BeforeReleaseCallCommand), Name = "BeforeReleaseCall" });[/code][list]
[/list]

I took all of the above code and information from the doc site (URL above).  Check it out, it should give you everything you need.

Regards,
Andrew

Offline GnomE

  • Newbie
  • *
  • Posts: 28
  • Karma: 0
Re: Handling button events "Done" window interaction
« Reply #5 on: July 16, 2014, 06:53:08 AM »
[b]abudwill[/b] yes I've read and seen how to register how commands and create your class. the question was what kind of command I use. You helped me by saying that it is possible in the logs to see what command worked out and I was able to intercept telephone interaction command completion
[code]commandManager.InsertCommandToChainOfCommandBefore("InteractionVoiceBeforeClose", "Close",
                new List<CommandActivator>() { new CommandActivator() { CommandType = typeof(OnInteractionDone), Name = "OnInteractionDone" } });[/code]
I chose the right team? to complete the email and chat need to use separate commands, or I can done use one command?

Hopefully correctly written and you will understand me. and thank you very much!  ;)

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Handling button events "Done" window interaction
« Reply #6 on: July 16, 2014, 12:21:31 PM »
All is described within the dev docs - for each media type there is set of command related to that channel.

Offline GnomE

  • Newbie
  • *
  • Posts: 28
  • Karma: 0
Re: Handling button events "Done" window interaction
« Reply #7 on: July 18, 2014, 08:56:48 AM »
Yes, thank you, thanks to the fact that possible view in the logs to execute commands, I was able to find the necessary, just thought have one common.
I was able to intercept the event of the button, but can not operate on a form. tell me how can I be? models are initialized empty can only get a singleton model, and to operate a class of my control (form) I can not.  ???

Offline GnomE

  • Newbie
  • *
  • Posts: 28
  • Karma: 0
Re: Handling button events "Done" window interaction
« Reply #8 on: July 28, 2014, 06:36:25 AM »
Friend, prompt please!
as soon I try to add something to my "IElementOfCommand" class in addition it stops working. Whether it's a different interface or keyword "partial". How do I make sure that I was able to work with the form and initialize models.  :-\

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: Handling button events "Done" window interaction
« Reply #9 on: August 04, 2014, 06:58:31 AM »
Just one recommendation  - visit the Genesys training for developers and learn more about WPF and MVVM pattern.

Offline fstephenster

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: Handling button events "Done" window interaction
« Reply #10 on: August 09, 2014, 01:19:24 PM »
Try the BundleClose Command. This command will be executed once you clicked the Done Button. This Command will be available for all Media Types like Media voice and Open Media.

http://docs.genesys.com/Documentation/IW/8.1.4/Developer/Outbound

Offline Ali

  • Jr. Member
  • **
  • Posts: 72
  • Karma: 0
  • Haunted by Genesys
    • My Web Site
Re: Handling button events "Done" window interaction
« Reply #11 on: November 08, 2017, 02:25:29 PM »
After more then 3 years, this threat has saved my life. Thank you!