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

  1. In Visual Studio, create a new Inbound Sequential Workflow Console Application.

  2. In the Visual Studio Toolbox, expand Unified Communications Workflow to display workflow activities.

  3. Drag and drop a SpeechQuestionAnswer activity from the Toolbox onto the design surface in communicationsSequenceActivity1 above disconnectCallActivity1.

  4. Add expected inputs to the ExpectedSpeechInputs property. For more information, see Authoring Grammars.

To add a statement confirming recognized speech

  1. 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.

  2. On the design surface, right-click speechStatementActivity1 and then click Generate Handlers.

  3. In the event handler, add the following statements:

    string response = this.speechQuestionAnswerActivity1.RecognitionResult.Text;
    this.speechStatementActivity1.MainPrompt.SetText("you said" + response);
  4. 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.

See Also


Walkthrough: Add Commands to a Workflow