Categories:
Outgoing middleware
Description of outgoing-middleware, that formats the outgoing message
Description
The outgoing-middleware properly formats the outgoing message with all the common properties needed in an Aura’s response.
The source code of this middleware is included in Aura Bot Platform middlewares - Github repository.
It extends the BotFramework class OutgoingMessageMiddleware, meaning that certain code is executed on message outgoing.
-
Firstly, it sets the correlator in
activity.channelData.correlator. -
Then, it sends the outgoing
MESSAGEentity row to the KPI handler. -
Then, it updates Aura Context with the last information of the message processing.
-
If there is any error both during these steps or in any other step, that would be stored in the
TurnContext, it would be properly added to theactivity.channelData. Any activity with an error would contain:-
The error text as
activity.text. -
As
activity.speak, the already setactivity.speakoractivity.text. -
activity.inputHint=acceptingInput -
activity.channelData.hasMoreMessages = false
-