Inserted Chain of Command not executing in correct order

261 views Asked by At

I am inserting a custom command in the chain "BundleClose" before the "GetAttachedDataInformationUCS" command, but it is executing the command after the "Close" command. I have tried inserting it before, after and with commands other than "GetAttachedDataInformationUCS", but it always gets executed after the "Close" command. How can I get it to work as intended?

_commandManager.InsertCommandToChainOfCommandAfter("BundleClose", "GetAttachedDataInformationUCS",
    new List<CommandActivator>
    {
        new CommandActivator
        {
            CommandType = typeof(UpdateDispositionDateCommand),
            Name = "UpdateDispositionDateCommand"
        }
    });

Here is the custom command:

public class UpdateDispositionDateCommand : IElementOfCommand
{
    public UpdateDispositionDateCommand()
    {
        Name = "UpdateDispositionDateCommand";
    }

    public bool Execute(IDictionary<string, object> parameters, IProgressUpdater progressUpdater)
    {
        return false;
    }

    public string Name { get; set; }
}

Here is a shortened version of the log that shows the incorrect command execution:

Exe CoC BundleClose -> Name:GetAttachedDataInformationUCS
Exe CoC BundleClose -> Name:UpdateNotePadForVoice 
Exe CoC BundleClose -> Name:ResetInteractionChatConsultation 
Exe CoC BundleClose -> Name:IsContactModified 
Exe CoC BundleClose -> Name:SipEndpointAskClearSEPCalls 
Exe CoC BundleClose -> Name:IsPossibleToClose 
Exe CoC BundleClose -> Name:CompleteDispositionCodeOnBundle 
Exe CoC BundleClose -> Name:ValidateEditableDataBundle 
Exe CoC BundleClose -> Name:Close 
Exe CoC InteractionVoiceBeforeClose -> Name:DoNotCallOutboundChain
Exe CoC InteractionVoiceBeforeClose -> Name:SetCallResultOutboundRecord
Exe CoC InteractionVoiceBeforeClose -> Name:RescheduleOutboundRecord
Exe CoC InteractionVoiceBeforeClose -> Name:UpdateRecordCommand
Exe CoC InteractionVoiceBeforeClose -> Name:MarkProcessedOutboundChainCommand
Exe CoC InteractionVoiceBeforeClose -> Name:RescheduleGMECallback
Exe CoC InteractionVoiceBeforeClose -> Name:SetGMECallbackDisposition
Exe CoC InteractionVoiceBeforeClose -> Name:ClearSessionCommand
Exe CoC InteractionVoiceBeforeClose -> Name:IsContactModified
Exe CoC InteractionVoiceBeforeClose -> Name:SipEndpointClearSEPCalls
Exe CoC InteractionVoiceBeforeClose -> Name:Close
Exe CoC BundleClose -> Name:UpdateDispositionDateCommand
Exe CoC BundleClose -> Name:StopInteractionVoiceUCS
Exe CoC BundleClose -> Name:GetOutboundPreviewRecord
2

There are 2 answers

1
orhun.begendi On BEST ANSWER

There is bug on that SDK. I can guarantee it. I submit many ticket about IWS/WDE sdk. There command usage bug because of Unity Container. Best way to do this using this.

As you can see at the bottom of the page there is GetAttachedDataInformationUCS is "0" command of the chain. If you insert 0 your command will be first. If you insert "1", will be; getattach. -> your command -> update ......

P.S. on execute method of your command, false is continue with next command, true is break the command chain.

P.S. It's provided solution by Official Genesys.

this.commandManager.CommandsByName["BundleClose"].Insert(0,
                    new CommandActivator() { CommandType = typeof(InteractionChatDisconnectChatEx) });

ChainBundleClose 

0 GetAttachedDataInformationUCS
1 UpdateNotePadForVoice 
2 ResetInteractionChatConsultation 
3 IsContactModified 
4 IsPossibleToClose 
5 CompleteDispositionCodeOnBundle 
6 Close 
7 StopInteractionVoiceUCS 
8 GetOutboundPreviewRecord 
0
Eric Scherrer On

Not sure why, but adding it before the "Close" command worked.