Step 1: Add a CommunicationsEventsActivity to a Communications Workflow Application

This is the first of two topics describing the steps to create the Add Events to a Workflow walkthrough application. This sequence of topics demonstrates how to add event activities to a speech and instant messaging (IM) Unified Communications Managed API 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 that recognizes speech

  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. Right-click communicationsSequenceActivity1 and then select View CommunicationsEvents. The event workflow designer appears, as shown in the following topic, Step 2: Construct a Workflow in the CommunicationsEventsActivity.

    Note

    The communicationsSequenceActivity1 activity is the required container for workflows, and is added to the project by default.

See Also

Concepts

Walkthrough: Add Events to a Workflow