Exercise 3: Create the Simple Expense Report Sequential Workflow

In this exercise, you finish creating the sequential workflow by adding activities that communicate with the host application.

The workflow starts by using an IfElseActivity activity to determine whether a manager or a lead person must approve the value specified in the Amount property that was set when the workflow began executing. After it determines this, the workflow calls a method defined in the host application to request user input for approval or rejection of the amount. When the Approve or Reject button is clicked, the host application raises the corresponding event, which is handled by one of the HandleExternalEventActivity activities that the workflow is waiting for. As soon as one of the events is raised and handled by the workflow, the workflow sets the Result property and completes its processing.

In the first task of this exercise, you use the CallExternalMethodActivity activity to call a method in the host application from the workflow. In the second task, you create a ListenActivity activity that contains two HandleExternalEventActivity activities to capture an approval or rejection event that is raised by the host application.

In This Section

Task 1: Create the CallExternalMethod Activities

Task 2: Create the HandleExternalEvent Activities

See Also

Reference

SequentialWorkflowActivity
CallExternalMethodActivity
HandleExternalEventActivity

Copyright © 2007 by Microsoft Corporation. All rights reserved.
Last Published: 2010-03-04