Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
by Keith Newman
Web Farm Framework enables you to define and schedule custom tasks using Workflow Builder. These custom tasks can run on all servers in your web farm. Using Workflow Builder, you can define tasks (workflows) that plug into most operations within a running web farm. You can have your own custom operations that run before and/or after a Web Farm Framework operation.
This article assumes you have a functioning web farm to work with. For information about setting up a web farm, see Setting up a Server Farm with the Web Farm Framework 2.0 for IIS 7 and Above.
To create a workflow provider using Workflow Builder
In IIS Manager under Connections, click your web farm, and then click Workflow Builder.
The Workflow Builder page is displayed. This page lists all workflows in the system.
Click Add Provider. T he Specify workflow details dialog is displayed.
For this simple example, you will create a workflow that runs a DIR command on a server. Enter the following information in the Specify workflog details dialog:
- In the Name box, enter
DirCommand
as the workflow name. - In the Operation Scrope box, select Server. The means the workflow will run on a selected server. If you select Webfarm, the workflow would run on the entire web farm.
- Leave the Run Remote check box selected.
- Leave the Retry Attempts and Retry Interval values at their default values. These values control how many attempts will be made to run the workflow and how long to wait after an unsuccessful attempt before trying again.
- Enter the following description:
Attempt to run a DIR command on the server.
- In the Name box, enter
Click Next. The Specify action details dialog will appear.
Enter the following information in the Specify action details dialog:
- In the Type box, select Command. This means the workflow action is defined using Windows shell commands. Alternatively, you could select Powershell to indicate you will use Powershell commands.
- In the Program/Script Path box, enter
dir {path}
. This box allows you to enter a command (as in this example) or the path to a program, a script, a batch file, or a Powershell file. - Under Parameters, define a parameter with
path
as the name, System.String as the type, and a period (.) as the default value. You may also enter a description of the parameter.
Click Next. The Specify recurrence details dialog is displayed.
The Specify recurrence details dialog enables you to select Dependencies (other workflow providers that your new provider depends on) and Dependants (other providers that depend on your new provider). It also enables you to set the Periodicity (how often your new workflow provider will re-run).
For this simple example, none of these settings are needed.
Click Finish and the new workload provider is added to the Workflow Builder page.
To run a workflow provider using Workflow Builder
In IIS Manager under Connections, select Servers, select and then click Server Operations.
On the Server Operations page, click Server.
[
Click DirCommand (or some other server operation you want to run), enter a value for the path parameter (or accept the default value), and the click Run.
After the command finishes, a success message appears in the box at bottom of the page.
Click Close.
The results of the command appear in the Trace Messages on the Servers page.