Applying workflows to documents

There are two ways in which you can apply a workflow on documents on your site:

  • Directly applying a workflow on a document - use this option if you want to apply a workflow on a document, or a document and its children, directly from the Pages application. Applying a workflow directly also creates a workflow scope.
  • Creating a workflow scope - use this option if you want to have more control when applying a workflow on the documents on your site. You can exclude documents from a workflow and control to which document types and cultures the scope applies. You can also create special conditions for each scope.

Applying workflows on documents in the Pages application

This functionality is useful when you want to apply a workflow on a document, or a document and its children, directly from the Pages application. For example, when you create a document outside of an existing workflow scope.

Users need to have the Manage workflow permission assigned in the content module to be able to use this functionality.

  1. In the Pages application, navigate to the document that you want to apply a workflow on.
  2. Click Apply workflow. A dialog box opens.
  3. Select the workflow that you want to apply on the document.
  4. Choose from the following options:
    1. To this document only
    2. To this document and its children
  5. Click Save & Close.

Applying a workflow on a document directly also creates a workflow scope that can be edited later.

Defining workflow scopes

A workflow scope defines the conditions based on which a workflow will be applied to documents. When creating a workflow scope, you have to specify a document’s path and whether you want to include child documents under this path. Then you can narrow down the set of covered documents by specifying some of the following parameters:

  • document type
  • culture
  • macro condition

The system offers two types of scopes - allowed and excluded. This way you can apply a workflow on a large section of a site and then exclude sections, which you don’t want the workflow to be applied on.

Workflow priority

If a document matches scopes of multiple workflows, the workflow with the most specific parameters is applied on the document. Scopes are applied with the following priorities, from highest to lowest:

  1. Scope with specified document type and culture
  2. Scope with specified document type
  3. Scope with specified culture
  4. Scope without specified document type and culture.
  5. Scope with the longest path.
  6. Scope that covers only the specified document without children.
  7. Scope that has its type set to Excluded.
  8. Scope with specified macro condition.

Workflow priority examples

The following table presents the most common scenarios, where scopes from two different workflows (Scope 1 and Scope 2 columns in the table) conflict with each other. The Result column explains which scope takes priority.

Scope 1 setup

Scope 2 setup

Result

This scope covers: /News

This scope covers: /News

Document type: Press releases

Press releases under the News document will use Scope 2, the News document itself and its other children will use Scope 1.

This scope covers: /Products

This scope covers: /Products/Smartphones

All documents under the Products document will use Scope 1, except for the Smartphones document and its child documents, which will use Scope 2.

This scope covers: /Products

This scope covers: /Products/Smartphones

Only specified document

All documents under the Products document will use Scope 1, except for the Smartphones document, which will use Scope 2. However, children under the Smartphones document will use Scope 1.

Creating a workflow scope

Before creating a workflow scope, you need to create a workflow first.

  1. In the Workflows application, edit an existing workflow.

  2. Select the Scope tab.

  3. Choose a site you want the scope to be effective on using the Site drop-down list.

  4. Click New workflow scope.

  5. Define the part of the content tree that you want to be covered by the scope. Click Select next to the This scope covers property.

  6. In the dialog that opens, choose the document you want covered by the scope.

  7. Specify whether you want to cover the document and its child documents, only the document or only its children.

  8. Select if you want the scope to be allowed or excluded. Keep the following behavior in mind when working with exclusions:

    Working with exclusions

    Exclude workflow from documents in this option applies only to the workflow under which it has been specified and does not override scopes in different workflows.

    For example, under Workflow 1, you have “/Products” and its children allowed and “/Products/Smartphones” excluded. Under Workflow 2, however, you have “/Products” and its children allowed and no exclusion specified. The exclusion specified under Workflow 1 will have no effect on the scope of Workflow 2.

    Creating a workflow scope

  9. Click Save.

Tip

If you want the scope to cover the whole site, or you want to specify only the parameters in the Advanced section, enter “/” (i.e. the path of the root document) in thefield next to the This scope covers property. Make sure that the scope covers the specified document including its children.

Advanced options

You can use these options to further refine the workflow scope. Keep in mind that the steps within the Advanced sections are optional.

  1. Choose a document type. The workflow will be applied only on documents of this type.

    1. Make sure the desired document type is assigned to the site you have selected.
    2. If you had to assign the document type to the site, click Save to refresh the page and load the newly assigned document type.
    3. Select the document type from the Document type drop-down list.
  2. Specify a culture. The workflow will be applied only on documents in this culture.

    1. Make sure the culture is assigned to the site you have selected.
    2. If you had to assign the culture to the site, click Save to refresh the page and load the newly assigned culture.
    3. Select the culture from the Culture drop-down list.
  3. Enter a macro condition. If the condition is met when starting a workflow cycle on a document within the scope, the workflow will be applied to the document.

    Specifying advanced properties of a workflow scope

  4. Save the workflow scope.

  5. If you want to apply the workflow to an existing document within the scope, make changes to the document.

    • If you’re using basic workflow, navigate to the document in the Pages application and click Save.
    • If you’re using advanced workflow, navigate to the document in the Pages application and click New version.