Bot Framework Composer中「Begin a new Dialog」动作的ActivityProcessed标记作用及使用示例咨询
Let's break down what this parameter does and walk through a concrete example to make it clear.
Core Concept
By default, the activity processed parameter is set to true. This tells the Bot Framework that the current dialog has already handled the incoming activity (like a user's message), so the dialog you're calling won't receive or process that same activity. When you set it to false, you're explicitly allowing the called dialog to act on the same incoming activity that triggered the current dialog.
Simple Usage Example
Let's say we have two dialogs:
- A
MainDialogthat handles initial message logging - A
SupportRequestDialogthat processes user support queries
Step 1: Configure MainDialog
In MainDialog, first add a "Send a response" action to do quick pre-processing (like logging):
"Logging your support request: {turn.activity.text}"
Next, add the "Begin a new Dialog" action, targeting SupportRequestDialog. Here's the critical part:
- Locate the
activity processedparameter in the action's settings panel - Set its value to
false
Step 2: Configure SupportRequestDialog
In SupportRequestDialog, add a "Send a response" action that uses the original user message:
"Got your support query: {turn.activity.text} - our team will follow up shortly."
What Happens When This Runs?
- User sends: "My app won't load"
MainDialogruns first, sends the logging response, then triggersSupportRequestDialog- Because
activity processedisfalse,SupportRequestDialogcan access and use the same "My app won't load" activity, so it sends its response using that exact text
If we left activity processed as true, the SupportRequestDialog wouldn't receive the original message activity—its turn.activity.text would be empty or undefined, since the main dialog marked the activity as "handled".
Common Use Cases
- Delegating processing of the same user input to a sub-dialog after initial work (like validation, logging, or routing checks)
- Building modular dialogs where different parts of your bot need to act on the same incoming activity
内容的提问来源于stack exchange,提问作者Matt

