Repeat
This activity repeats a set of activities, as long as conditions are satisfied. Learn about tokens this activity produces
Note: The Repeat activity is very resource intensive if it is left to repeat continuously. You should configure the activity's conditions so that they will be met by the workflow itself (e.g., the activity's condition is that it will repeat five times), or you should place a Wait for Entry Change inside this activity so that it pauses between repeating. You should never use the Repeat activity if you can use a Deadline activity, Escalation activity, or starting event instead.
Example: All project proposals need to include the project's type (as set in the field Type) in their names. The project type can change, depending on current business needs, even while the project is waiting for approval. To make sure that the project proposal always has the correct name, George configures a workflow that has a Retrieve Field Values, Rename Entry, and Wait for Entry Change activity inside a Repeat activity. The first time the Repeat activity runs, it renames the proposal using the value in the Type field. The workflow then waits for either the proposal to be approved or for the Type field to change. If the Type field changes, the Repeat activity runs again and renames the proposal to reflect the new project type. The Repeat activity will run every time the project type changes until the proposal is approved.
To set up this activity:
- Drag the activity from the toolbox pane and drop it in the Designer pane.
- In the properties pane, type a name and description of the activity.
- In the Connection Profile property box, select the repository you want the activity to use.
- In the Repeat Condition property box, click Edit Conditions... to create conditions.
- Configure the conditions.
- Optional: You can create as many conditions as you want by clicking Add condition.
- Click OK.
- In the Options property box, you can limit the number of times the Repeat activity can repeat.
- To limit the number of times the activity will repeat, select Limit number of repetitions to. If you do not select this option, the default limit is 500 iterations. Click the Token button (right arrow) to add a token.
- Select whether you want the activity to check its condition Before running contained activities or After running contained activities.
- If the condition is checked before the contained activities run, and the condition is initially satisfied, the activities inside the Repeat activity will be skipped.
- If the condition is checked after the contained activities run, the activities inside the Repeat activity will always run at least once, regardless of the condition.
- Under Start the Iteration token at, select what number the Iteration token will start at when it begins to count the number of times the Repeat activity has repeated. If you select 0, the first time the Repeat activity runs the Iteration token’s value will be zero. If you select 1, the first time the Repeat activity runs the Iteration token's value will be 1.
Tip: If you are using the Iteration token to index a multi-value token, you may want to select 1 because indexes start at 1 instead of 0.
You may want to disable activities if you only want to test specific sections of your workflow. To disable activities:
- Select an activity in the designer pane to highlight it.
- In the Description property box, clear Enable.