Step 1: Add a CommunicationsEventsActivity to a Communications Workflow Application

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

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) Microsoft Unified Communications Managed API application using Microsoft Visual Studio 2008 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 2008, create a new Inbound Sequential Workflow Console Application.

  2. In the Visual Studio 2008 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 2008, 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.


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

See Also


Walkthrough: Add Events to a Workflow