Skip to end of banner
Go to start of banner

Make tasks disable a review

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Overview

These examples show two approaches for preventing a content review if there are any outstanding workflow tasks. 

  • the first example uses a precursor state to complete the tasks. The transition to the content review occurs only when the tasks are complete

  • the second example uses a value reference condition (used together with a third-party app) in the content review state

 The value reference condition example requires installation of the Appfire Reporting for Confluence app in addition to Comala Document Management.

Using the tasks completed transition in a precursor state to disable a review

It's achieved by adding a state as a precursor state to the Review state. This precursor state contains a completed transition that occurs when all the tasks are complete.

{workflow:name=Complete the tasks}
   {state:Editing|submit=CompleteChecklist}
   {state}
   {state:CompleteChecklist|completed=Review|description=Complete all tasks to undertake the content review|taskable=true}
	   {task:Proof read content}
	   {task:TPS Report Added}
	   {task:All images show latest version}
   {state}	
   {state:Review|approved=Done|rejected=Editing} 
      {approval:Review|assignable=true}
   {state}
   {state:Done|updated=Editing}
   {state}
{workflow}


In this simple example, the Review state containing the content review is only available as a submit transition destination state from CompleteChecklist.

In the CompleteChecklist state, no transition options are available in the workflow popup. The workflow is waiting for the taskscompleted event for the completed transition to occur.

It's best to have at least one task added by the workflow on the transition to the CompleteChecklist state as a task will need to set as Complete in the tasks popup for the transition to occur.

You can also make the CompleteChecklist (or Editing) state taskable.

The transition to the content review state Review will occur when all tasks are complete.

Using a value reference condition to disable a review

It's achieved using a condition on the approval macro.

{workflow:name=Complete the tasks}
   {state:Editing|submit=Review}
   {state}
   {state:Review|approved=Done|rejected=Editing}
      {task:Complete this to review}
      {approval:Review|assignable=true|@workflow:tasks > size@=0}
   {state}
   {state:Done}
   {state}
{workflow}

The type of condition used in this example is one of several available only when the Reporting for Confluence app is installed.

When this workflow reaches the Review state, a single task is added. Only when that task is complete can reviewers Approve or Reject the content.

Users can still be assigned to the review even if there are tasks, but they cannot Approve or Reject until the tasks are complete.

How the value reference condition works

The approval uses a Value Reference condition that checks the number of tasks by querying the Workflow Supplier. If there are no tasks, the condition is met, and the review will be enabled.

Let's take a look at the condition:

@workflow:tasks > size@=0

Here's how that works:

  • content between the two @ symbols is a Value Reference

  •  workflow: indicates we are querying the Workflow Supplier

  • tasks indicates we want to access the tasks object within the supplier – it provides information about all the tasks on the current page or blog post

  •  > indicates we want to query an attribute on the tasks object, in this case, the size attribute which tells us how many tasks there are

  • this is then equated to a number, in this case 0

This could be set up so that the review is only enabled if there is one or more tasks by changing the condition to:

@workflow:tasks > size@=!0

Adding the exclamation mark means "NOT", so this condition requires that "the number of tasks is not zero".

The Workflow Supplier condition must be added as markup using the macro editor. It cannot be added in the approval editor in workflow builder.

Once added in the markup editor, it will be displayed in the approval editor in workflow builder.

But you will not be able to change this individual approval using workflow builder with this markup added. However, you can edit/amend other components of the workflow using workflow builder.

See also

Workflow Authoring Guide

User Guide

  • No labels