ภาษา

TaskModule Class

Definition

Provides methods for registering handlers for Teams Task Module fetch and submit events.

public class TaskModule
type TaskModule = class
Public Class TaskModule
Inheritance
TaskModule

Remarks

Task Module routing uses a key/value pair embedded in the activity data to identify which handler to invoke. When Teams delivers a fetch or submit request, the SDK reads a named field from the activity data and compares its value against the registered handlers.

The default field name is "task". The value of that field (for example, "simple_form") determines which OnFetch or OnSubmit handler is called. The field name can be overridden per handler using the key parameter, but it is strongly recommended to keep the default "task" for both fetch and submit — varying only the value — to keep routing consistent and simple.

For example, if a card's submit action data contains { "task": "simple_form" }, then the handler registered with OnFetch("simple_form", ...) is called for the fetch and OnSubmit("simple_form", ...) is called when the user submits the form.

Methods

Name Description
OnFetch(Regex, TaskFetchHandler, String, String[], UInt16)

Registers a handler to process the fetch of a task module. The value of the "task" key (or the specified key) in the activity data is matched against valuePattern to determine whether this handler should be triggered.

OnFetch(String, TaskFetchHandler, String, String[], UInt16)

Registers a handler to process the fetch of a task module. The value of the "task" key (or the specified key) in the activity data is matched against value to determine whether this handler should be triggered.

OnSubmit(Regex, TaskSubmitHandler, String, String[], UInt16)

Registers a handler to process the submission of a task module. The value of the "task" key (or the specified key) in the activity data is matched against valuePattern to determine whether this handler should be triggered.

OnSubmit(String, TaskSubmitHandler, String, String[], UInt16)

Registers a handler to process the submission of a task module. The value of the "task" key (or the specified key) in the activity data is matched against value to determine whether this handler should be triggered.

Applies to