Genesys CTI User Forum > Genesys-related Development

Handling button events "Done" window interaction

(1/3) > >>

GnomE:
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?

Kubig:
I strongly recommend to you achieve that through commands.

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

GnomE:
friends, the question is relevant... help please  :-\

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

Navigation

[0] Message Index

[#] Next page

Go to full version