Creating process definitions

Process definitions define the jobs and steps in a build processes.

Process definitions are attached to process templates, so before you can define a process, you must create a process template.
You define processes by inserting jobs into the process and configuring properties that are related to the jobs. Steps are collected into jobs that are composed into processes. When you place a job in a process, you choose options such as the agent pool to run it, and the working directory, among other settings.
  1. On the left navigational panel, click Templates > Process.
  2. In the Process Templates page, select a process template, and then click Definition.
  3. Using the Definition page's design area, define the process by completing these steps:
    1. Click the Start icon in the Definition area, and select Insert Job After.
      When you click a definition icon, a menu of related actions is displayed. If you click Stop, for example, the Insert Job Before action is available.
      The Insert Job After action menu
      The following table describes all definition menu actions.
      Table 1. Workflow action menu
      Action Description
      Edit Configuration Change the precondition script, agent filter, or working directory script on the job.
      Edit Job Steps Edit the individual job steps.
      Insert Job After Insert a job into the process. The selected job is the inserted job's parent and all of the selected job's children become the inserted job's children.
      Insert Job Before Insert a job into the process. The selected job is the child of the inserted job and the selected job's parents are the parents of the inserted job.
      Add Parallel Job Add a job to run in parallel to the selected job.
      Iterate Job Iterate the job a specified number of times.
      Iteration Properties Edit the properties specific to each job iteration.
      Delete Remove the job from the process definition.
  4. Complete the following steps to define the properties that are related to the inserted job.
    1. Select the job that you want to insert into the process from the Jobs list.
    2. Select the job precondition from the Pre-Condition list.
      The job pre-condition script determines whether the job runs. For information about the job pre-condition scripts, see Creating step-precondition scripts. The precondition script runs before the agent filter runs.
    3. Use the Agent Selection options to specify an agent pool. To pick a specific pool, click Agent Pool Selection and select the pool from the list. The job runs on the first available agent in the selected pool. To select the pool by agent pool property, click Agent Pool Property and type the property, such as ${p:my.property}. . If you do not want to use an agent or working directory for the job, select No Agent. This option requires that the job runs steps on the server, such as stamping or server-side scripts.
    4. Select a script from the Working Directory list.
      The selected script defines the path to the working directory for the job. The Default Workflow Directory script uses the agent's default directory, which is{agent}/var/work/project/{project}/{workflow}. The Unique Job Directory script uses a separate directory for each job: {agent}/var/work/job/{job_id}. The Source Config's Working Directory script uses the directory that is defined for the source configuration.
    5. Specify when you want the working directory cleaned by selecting an option from the Working Directory Cleanup list.
    6. Lock for Workflow
      Agents and their working directories are always locked when they process jobs. The No option locks the agent and working directory only during the current job. The Yes option locks the agent and working directory for the entire workflow and prevents other workflows from using the working directory.
  5. Click Save.
The job is inserted into the process, as shown in the following figure:

Job added to the process
Add more jobs to the process. Jobs can be inserted before or after other jobs. A process can have any number of jobs.