Step 1: Add a CommandsActivity to a Communications Workflow Application
This is the first of two topics describing the steps to create the Add Commands to a Workflow walkthrough application. This sequence of topics demonstrates how to add command activities to a speech and an instant messaging Unified Communications Managed API (UCMA) application using Microsoft Visual Studio development system. The procedures for creating the walkthrough application build sequentially. Completing the procedures in sequence is important.
Creating a Speech Recognition Application
To create a communications workflow application
In Visual Studio, create a new Inbound Sequential Workflow Console Application.
In the Visual Studio Toolbox, expand Unified Communications Workflow to display workflow activities.
Drag and drop a SpeechQuestionAnswer activity from the Toolbox onto the design surface in communicationsSequenceActivity1 above disconnectCallActivity1.
Add expected inputs to the ExpectedSpeechInputs property. For more information, see Authoring Grammars.
To add a statement confirming recognized speech
In Visual Studio, drag and drop a SpeechStatement activity onto the design surface in communicationsSequenceActivity1 between speechQuestionAnswerActivity1 and disconnectCallActivity1. This statement activity replays the recognition result.
On the design surface, right-click speechStatementActivity1 and then click Generate Handlers.
In the event handler, add the following statements:
string response = this.speechQuestionAnswerActivity1.RecognitionResult.Text; this.speechStatementActivity1.MainPrompt.SetText("you said" + response);
In the workflow designer right-click communicationsSequenceActivity1 and then click View Commands. The command workflow designer appears, as shown in the following topic, Step 2: Construct a Workflow in the CommandsActivity.