Implement parallel optional approvals in a workflow

This workaround is for Server/Data Center version of Comala Document Management

Sometimes it could be needed to have a parallel approval to be optional apart from the required one so in case any user has been assigned to the optional approval before the required approval is completed, it will be needed to undertake it for the content to be transitioned.

See an example workflow markup below:

{workflow:name=Simple approval workflow|key=spaceworkflow-2069888558} {description} The Simple Approval Workflow has 2 states. In Progress: Staff edit pages, not visible to non-team members. Approved: Staff approve, visible to public. {description} {workflowparameter:Optional_Reviewers|type=user|edit=true} {workflowparameter} {state:In Progress|approved=Approved|taskable=true|colour=#ffab00} {approval:Mandatory Review|assignable=true} {approval:Optional Review|selectedapprovers=@Optional_Reviewers@} {state} {state:Approved|final=true|updated=In Progress|hideselection=true} {state} {trigger:pageapproved|approval=Mandatory Review|@Optional Review>approvalassignees@=@Empty@} {set-state:Approved} {trigger} {workflow}

In the markup above there are 2 approvals in the In Progress state. The second one is set with a workflow parameter type user called @Optional Reviewers@ so that's the approval that will not be mandatory to be carried through for the content to be transitioned to the Approved state but only the first approval.

As you see, there is a trigger which is listening to when the mandatory approval (called Review) is approved and, if there is no reviewer assigned to the optional approval (called Optional Review), content will be transitioned to Approved state.

On the other hand, if Optional Review had any assigned reviewer in the moment Review approval is approved, content won’t be transitioned until the Optional Review approval is done.

Multiple required approvals

In case there are more than one required approval, you can use hasapproval condition and add as many triggers as are comparisons needed:

{workflow:name=Simple approval workflow|key=spaceworkflow-2069888558} {description} The Simple Approval Workflow has 2 states. In Progress: Staff edit pages, not visible to non-team members. Approved: Staff approve, visible to public. {description} {workflowparameter:Optional_Reviewers|type=user|edit=true} {workflowparameter} {state:In Progress|approved=Approved|taskable=true|colour=#ffab00} {approval:Mandatory Review 1|assignable=true} {approval:Mandatory Review 2|assignable=true} {approval:Mandatory Review 3|assignable=true} {approval:Optional Review|selectedapprovers=@Optional_Reviewers@} {state} {state:Approved|final=true|updated=In Progress|hideselection=true} {state} {trigger:pageapproved|approval=Mandatory Review 1|hasapproval=Mandatory Review 2|hasapproval=Mandatory Review 3|@Optional Review>approvalassignees@=@Empty@} {set-state:Approved} {trigger} {trigger:pageapproved|approval=Mandatory Review 2|hasapproval=Mandatory Review 1|hasapproval=Mandatory Review 3|@Optional Review>approvalassignees@=@Empty@} {set-state:Approved} {trigger} {trigger:pageapproved|approval=Mandatory Review 3|hasapproval=Mandatory Review 1|hasapproval=Mandatory Review 2|@Optional Review>approvalassignees@=@Empty@} {set-state:Approved} {trigger} {workflow}