Make tasks disable a review
Overview
These examples show two approaches for preventing a content review if there are any outstanding workflow tasks
In the first example, the transition to the content review occurs only when the tasks are complete.
In the second example, the content review (approval) is enabled when the number of workflow tasks yet to be completed is zero.
The second example value reference condition 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 Referenceworkflow:
indicates we are querying the Workflow Suppliertasks
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 thetasks
object, in this case, thesize
attribute which tells us how many tasks there arethis 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:
Adding the exclamation mark means "NOT", so this condition requires that "the number of tasks is not zero".