> ## Documentation Index
> Fetch the complete documentation index at: https://docs.directgvr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Progress

> Report unified progress across workflow tasks.

## Overview

The purpose of the **progress**  task is to bind multiple tasks to a single progress bar.

The progress task has the following features:

* Chain together multiple tasks into a single progress bar.
* Include tasks in the progress bar that don't normally have a progress associated with them.
* Custom progress bar allocation options:
  * Specify how much of the progress bar particular tasks consume.
  * Use automatic allocation of the progress bar to all tasks.
  * Combine specified and automatic allocation.
  * Specify tasks that do not affect your progress bar.

## Task

The arguments for the progress task are listed below.

| Name | Type | Description | Default |
| - | - | - | - |
| **actions** | string/array | List of tasks that make up the progress bar. Each task in the list is further evaluated by checking their argument list for "actions", "complete", and other entries in taskChainParameter. | |
| maxPercentage | number (0 - 100.0) | Maximum range of the progress bar. | 100.0 |
| taskChainParameter | string/array | A list of arguments on tasks to follow when building the progress bar. For example: \["success","failure","complete", "notEqualTo"]. "actions" is always an implied member of this list. | \["complete"] |
| verbose | boolean | Prints verbose debug information in the log. | false |

Any sub-task run by the progress task can have the following arguments:

| | Type | Description | Default |
| - | - | - | - |
| progressWeight | number (0-1.0) | A value of 0 will exclude this task from any progress calculation. Other numbers will assign that percentage of the progress bar to this task. Be sure all of your progressWeight values add up to less or equal to 1.0! | Based on the total number of tasks discovered by the Progress task, where each task is given an equal amount of the unassigned progress bar. |
| progressWaitTime | number (1-N) | A value > 0 will cause the progress bar to fill its space every second until the number of seconds given here has been reached. See also progressWaitLimit and progressWaitInterval. | 0 (meaning the entire allotted progress is filled on completion, or according to that task's specific progress rules.) |
| progressWaitInterval | number (0.1-N) | Denotes the number of seconds between each progress bar update when using the progressWaitTime argument. Does nothing otherwise. | 1.0 (second) |
| progressWaitLimit | number (0-1.0) | The maximum percentage of this task's allotted amount that will be periodically filled in when using the progressWaitTime argument. This is useful if you don't want the entire amount filled in until the task completes. | 1.0 (all of the allotted progress). |
| progressAggregate | boolean | When set to *true* , it will use the task's progress for a separate aggregate progress bar. This can be used with the aggregate task, where subtasks are created dynamically based. | false |
| taskChainEnd | boolean | Indicates the end of the chain of tasks to consider when adding tasks to the progress bar. Further tasks may be executed by the workflow engine, but they will not be part of the progress bar. | false |

**Status Variables:**

| Name | Type | Description |
| - | - | - |
| progress | number | Overall progress |

**Changes:**

* 5.2 - Added progressAggregate argument
* 7.2 - Added progress status variable

## Examples

Below is an example workflow that combines two tasks into a single progress bar. In this instance the progress bar will automatically allocate to each task an equal amount of the progress bar (50%).

```json theme={null}
start:
  type: progress
  actions:
    - sync
    - syncComm
sync:
  type: repositorySync
  repository: "{repositoryName}"
  catalog: "{catalogUrl}"
  metafile: "{pathJoin:{repositoryDirectory},{repositoryName}-meta.json}"
  local:
    type: file
    path: "{repositoryDirectory}"
  backup:
    type: filePiece
    path: "{pathJoin:{repositoryDirectory},backup}"
  status: UI_Updating
syncComm:
  type: repositorySync
  repository: "{repositoryComm}"
  catalog: "{catalogComm}"
  metafile: "{pathJoin:{repositoryDirectory},{repositoryComm}-meta.json}"
  local:
    type: file
    path: "{repositoryDirectory}"
  backup:
    type: filePiece
    path: "{pathJoin:{repositoryDirectory},backup}"
  status: UI_Updating
  success: syncComplete
```

When the progress task runs, it will internally construct a chain of tasks that make up the progress bar. It builds this task chain by analyzing all subsequent tasks in the workflow. It starts with the "actions" listed in the progress task and follows each task through it's "complete" argument. You can specify other properties for the progress task to look for by changing the *taskChainParameter*  argument of the progress task.

The key points are:

* The progress task consists of all tasks in the "actions" argument.
* The progress task also consists of all sub-tasks of the tasks listed in the "actions" argument through the sub-task's "complete" argument.
* By default, all tasks in the progress bar's task chain will show in the progress bar.
* By default, all tasks in the progress bar's task chain are given an equal part of the progress bar.

Below is a more complex example:

```json theme={null}
start:
  type: progress
  maxPercentage: 95
  actions:
    - firsttask
    - secondtask
    - thirdtask
    - fourthtask
    - fifthtask
firsttask:
  type: open
  path: http://www.google.com
  progressWeight: 0.1
secondtask:
  type: unzip
  path: "{pathJoin:{modulePath},installPackage1.zip}"
  outputDirectory: "{pathJoin:{modulePath},subdir}"
  progressWeight: 0.2
thirdtask:
  type: open
  path: http://www.google.com
  progressWeight: 0
fourthtask:
  type: unzip
  path: "{ModulePath}installPackage2.zip"
  outputDirectory: "{pathJoin:{modulePath},subdir}"
  progressWeight: 0.4
fifthtask:
  type: launch
  path: "{pathJoin:{modulePath},myprogram.exe}"
  workingDirectory: "{modulePath}"
  elevationRights: "asinvoker"
  waitForExit: false
  progressWaitTime: 10
  progressWaitInterval: 1
```

In the above example, we have five tasks listed in the progress task's "actions" argument.

* The progress bar will only go up to 95%, instead of the normal 100%.
  * This is controlled by the *maxPercentage*  argument on the progress task. The remaining 5% might be handled by custom JavaScript outside of the workflow engine.
* The progress bar allocation is customized, with each task making up a different percentage of the progress bar.
  * This is controlled by the *progressWeight*  argument on the progress sub-task.
  * The firsttask is given 0.1 (10%) of the progress bar, the secondtask is given 0.2 (20%), the thirdtask is given 0 (0%), the fourth task is given 0.4 (40%), and the fifthtask is given the remaining unallocated percentage (30%).
  * You can use a progressWeight value of 0.0 to prevent a task from being used by the progress bar at all. This is an especially useful thing to do when a task has a neutral function, such as a "queue" type or check type task.
* The launch task has a timed progress that simulates progress on a task based on time elapsed.
  * This is controlled by the *progressWaitTime*  and *progressWaitInterval*  properties on the progress sub-task.
  * Assigns an arbitrary amount of time, in this case 10 seconds (*progressWaitTime)* , in increments of 1 second (*progressWaitInterval* ) to fill up the 30% of the progress bar it has allocated to it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.