Using Web Workflow Roles Sample
The sample demonstrates how to use Web roles in a workflow.
The high level scenario is as follows:
A SequentialWorkflowActivity activity named PurchaseOrderWorkflow is instantiated.
The employees who can initiate the PurchaseOrderWorkflow are limited to the persons who are specified in the WebWorkflowRole object that is created in the workflow.
The HandleExternalEventActivity activity initiates a purchase order only if the initiator is a member of the configured Web roles. The initiator (employee) identity is assumed to be the identity of the person who is running the workflow sample.
To set up, build, and run the sample
Download the sample by clicking Download Sample.
This extracts the sample project to your local hard disk.
Open a command prompt and go to the %windir%\Microsoft.NET\Framework\v2.0.50727\ directory.
Run aspnet_regsql.exe to set up and configure the ASP.NET databases.
Click Start, point to Programs, point to Microsoft Windows SDK, and then click CMD Shell.
Go to the source directory of the sample.
At the command prompt, type MSBUILD <Solution file name>.
In the sample, the initiating user is set to be Amanda. The role that is configured on the HandleExternalEventActivity activity is Clerk.
To run the sample, run the .exe file in the PurchaseOrderWorkflow\bin\debug folder (or the PurchaseOrderWorkflow\bin folder for the Visual Basic version of the sample), which is located below the source folder of the sample.
In the Program.cs file, change the initiating user to someone other than Amanda.
Build and run the sample again to verify that the purchase order was not approved.
© 2007 Microsoft Corporation. All rights reserved.