Executing Tasks in a Custom Order

Note  This content applies to the Windows Logo Kit (WLK). For the latest information using the new Windows Hardware Certification Kit (HCK), see Windows HCK User's Guide on the Windows Hardware Dev Center.

The tasks in a job can be assigned to the setup, regular, or cleanup phases. Tasks in the regular phase execute after all of the tasks in the setup phase finish executing. Tasks in the cleanup phase execute after all of the tasks in the regular phase finish executing, or after a task in the setup or regular phase fails and the failing task's failure action is FailAndStop.

Within a phase, you can declare that the tasks run in series or in parallel. In addition to serial and parallel execution, you can create daemon tasks that begin running either before or after all other tasks and might run in parallel with the other tasks. If you need to provide a more complex ordering of tasks within a phase, you can create custom dependencies. Custom dependencies are particularly useful for jobs that execute on more than one computer simultaneously, such as jobs that use a Logical Machine Set (LMS). You can create dependencies between two tasks that execute on the same computer, between two tasks that execute on all computers, or between two instances of the same task that execute on different computers.

For example, consider a job that has three tasks and requires two client computers. The first task distributes data to both computers. Unfortunately, the program that distributes data can only run on one computer at a time. The second task runs the test. However, the test cannot run on a computer until the data has already been distributed to that computer. The third task collects the results of the test on both computers. Before it can collect the results, though, the test must have finished running on all computers. The following figure illustrates these dependencies.

Example of tasks that require custom dependencies

Note  This content applies to the Windows Logo Kit (WLK). For the latest information using the new Windows Hardware Certification Kit (HCK), see Windows HCK User's Guide on the Windows Hardware Dev Center.

You can represent the requirements for ordering the tasks by using custom dependencies. The following table shows how you would define the dependencies.

Task 1 (T1) Task 2 (T2) Dependency

Distribute

Distribute

T2 on each machine executes after T1 on previous machine

Distribute

Test

T2 on each machine executes after T1 on same machine

Test

Collect

T2 on all machines executes after T1 on all machines

 

To specify a custom order for task execution

Note  This content applies to the Windows Logo Kit (WLK). For the latest information using the new Windows Hardware Certification Kit (HCK), see Windows HCK User's Guide on the Windows Hardware Dev Center.

  1. Create or edit a job and add all of the tasks for the job.

  2. Select the Tasks tab in the bottom pane of the New Job window, and then select either the Setup tab to create dependencies between tasks in the setup phase, the Regular tab to create dependencies between tasks in the regular phase, or the Cleanup tab to create dependencies between tasks in the cleanup phase.

  3. Select Execute these tasks according to custom dependencies, and then click Dependencies.

    Note   The Dependencies button will appear after you select Execute these tasks according to custom dependencies.

  4. Click Add in the Task Dependency List dialog box.

  5. In the Add Task Dependencies dialog box, select the dependent task as T2. This is the task that will execute after the task that you specify next.

  6. Select the task that T2 depends on as T1.

  7. In the Dependency area, select the type of dependency that exists between the task that you designated as T1 and the task that you designated as T2. The dependencies you can select include:

    • T2 on all machines executes after T1 on all machines: T2 will not execute until T1 has finished executing on all of the computers that task T1 is scheduled to run on.

    • T2 on each machine executes after T1 on same machine: T2 on a specific computer will execute after T1 on that same computer has finished executing.

    • T2 on each machine executes after T1 on previous machine: Only one instance of the task can run at a time. When the task finishes running on one computer, it can be started on another computer.

      Note   This option is only available if you select the same task as both T1 and T2.

  8. Click OK.

  9. Repeat this procedure beginning at step 4 to define additional dependencies for this job phase.

  10. Repeat this procedure beginning at step 2 to define custom dependencies for the other job phases.

 

 

Build date: 9/14/2012