Share via


BotFrameworkAdapter.ProcessActivityAsync Method

Definition

Overloads

ProcessActivityAsync(ClaimsIdentity, Activity, BotCallbackHandler, CancellationToken)

Creates a turn context and runs the middleware pipeline for an incoming activity.

ProcessActivityAsync(String, Activity, BotCallbackHandler, CancellationToken)

Creates a turn context and runs the middleware pipeline for an incoming activity.

ProcessActivityAsync(ClaimsIdentity, Activity, BotCallbackHandler, CancellationToken)

Creates a turn context and runs the middleware pipeline for an incoming activity.

public override System.Threading.Tasks.Task<Microsoft.Bot.Builder.InvokeResponse> ProcessActivityAsync (System.Security.Claims.ClaimsIdentity claimsIdentity, Microsoft.Bot.Schema.Activity activity, Microsoft.Bot.Builder.BotCallbackHandler callback, System.Threading.CancellationToken cancellationToken);
override this.ProcessActivityAsync : System.Security.Claims.ClaimsIdentity * Microsoft.Bot.Schema.Activity * Microsoft.Bot.Builder.BotCallbackHandler * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Builder.InvokeResponse>
Public Overrides Function ProcessActivityAsync (claimsIdentity As ClaimsIdentity, activity As Activity, callback As BotCallbackHandler, cancellationToken As CancellationToken) As Task(Of InvokeResponse)

Parameters

claimsIdentity
ClaimsIdentity

A ClaimsIdentity for the request.

activity
Activity

The incoming activity.

callback
BotCallbackHandler

The code to run at the end of the adapter's middleware pipeline.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

A task that represents the work queued to execute.

Applies to

ProcessActivityAsync(String, Activity, BotCallbackHandler, CancellationToken)

Creates a turn context and runs the middleware pipeline for an incoming activity.

public System.Threading.Tasks.Task<Microsoft.Bot.Builder.InvokeResponse> ProcessActivityAsync (string authHeader, Microsoft.Bot.Schema.Activity activity, Microsoft.Bot.Builder.BotCallbackHandler callback, System.Threading.CancellationToken cancellationToken);
override this.ProcessActivityAsync : string * Microsoft.Bot.Schema.Activity * Microsoft.Bot.Builder.BotCallbackHandler * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Builder.InvokeResponse>
Public Function ProcessActivityAsync (authHeader As String, activity As Activity, callback As BotCallbackHandler, cancellationToken As CancellationToken) As Task(Of InvokeResponse)

Parameters

authHeader
String

The HTTP authentication header of the request.

activity
Activity

The incoming activity.

callback
BotCallbackHandler

The code to run at the end of the adapter's middleware pipeline.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

A task that represents the work queued to execute. If the activity type was 'Invoke' and the corresponding key (channelId + activityId) was found then an InvokeResponse is returned, otherwise null is returned.

Implements

Exceptions

activity is null.

authentication failed.

Remarks

Call this method to reactively send a message to a conversation. If the task completes successfully, then if the activity's Type is Invoke and the corresponding key (ChannelId + Id) is found then an InvokeResponse is returned, otherwise null is returned.

This method registers the following services for the turn.

See also

Applies to