Esko Logo Back to Esko Support
Choose your language for a machine translation:
Skip to end of metadata
Go to start of metadata



In order to repeat a part of your business logic, you may have created a workflow loop.

For example, every time a document gets rejected, you need to create a task for your designer to upload a new version of the document. Maybe, you want to execute this loop only a limited number of times. For example: If after five iterations, the artwork is still rejected, the changes to the packaging are disregarded.

This article describes how you can configure a workflow loop so it is only executed x times.


Follow these steps to modify a workflow loop, so that, it is executed only x times:

  1. Create a new text attribute in the system named Counter:
    1. Choose Admin > Attributes from the menu.
    2. Click New attribute in the top right corner.
    3. Enter as name Counter.
    4. Select Text as Type.
    5. Values should be Prompted.
    6. Enable Attribute is also a task specification option.
  2. Add the new specification to your task type:
    1. Choose Task Types from the main menu.
    2. Find your workflow task type and click the name to open it.
    3. Go to the Specifications tab.
    4. Add the new attribute Counter by selecting it and clicking the add >> button.
    5. Click Save to save your changes.
  3. Modify the workflow loop:
    1. Go to the Workflow tab in your task type.
    2. As an example, let's assume your loop looks like the screenshot given below. After rejection of the document uploaded in Upload Artwork, the designer has to upload a new version and the approval cycle starts again. We want to limit this loop so it can be executed only five times.

    3. Add a Set Workflow Specification node at the beginning of your loop.
    4. Double click it to modify the parameters. The specification Counter should be displayed. If not, refresh your page and add the node again.
    5. Click the [] in the Value column. Go to the Specifications category and insert the SmartName, Counter. Add a c after it. 

    6. Add a Router node at the end of your loop.
    7. Double click it to modify the parameters. We will route on the workflow specification Counter.
    8. Change the first rule to matches and add the regular expression c{5} as value. This will match if the Workflow Specification is ccccc (5 times "c"). You can take any number. Rename the output pin for the no match rule to no match.

    9. Connect the no match output pin of the router to the beginning of your loop: the Set Workflow Specification node.

    10. The other green output pin c{5} can be connected to nodes that have to be executed if the loop has been repeated five times.

More details

The first time the loop is executed, the Counter workflow specification will get the value c. The router checks for ccccc, which means it continues to the no match output pin. The loop will be executed again. The second time the Counter workflow specification will get the value cc. Again the router will continue to the no match output pin, etc.. After five times however, the workflow specification Counter will be set to ccccc, so we can do something different. In the example, we just marked the workflow as completed in that case.

Article information
Applies to

WebCenter 12 and newer

Last revised 
CW Number