This documentation relates to Ad hoc Workflows 3.2
If you are using version 3.1 of the plugin, please view the previous version of the plugin documentation

Lesson 3 - Working with Workflow Parameters

Skip to end of metadata
Go to start of metadata

In the previous tutorial, we created a workflow with approvals restricted to a group and to a user.

To be able to change the group and the final approver without having to change the workflow, we use Workflow Parameters.

Workflow Parameters

Workflow parameters allows us to define placeholders in the workflow markup. These placeholders can have default values and they can be changed for entire State on which the workflow is active.

We use the {workflowparameter} to define the parameters. We are going to define a Reviewers parameter and a Editor-in-Chief parameter.

Then, we are going to refer to those parameters in the approvals as @Reviewers@ and @Editor in Chief@:

{workflow:name=Basic Workflow}
    {workflowparameter:Reviewers|description=Reviewers group|type=group}
        confluence-users
    {workflowparameter}
    {workflowparameter:Editor in Chief|description=User able to give final approval|type=user}
        @user@
    {workflowparameter}

    {state:Draft|submit=Ready}
    {state}
    {state:Ready|approved=Reviewed|rejected=Draft}
        {approval:Review|group=@Reviewers@}
    {state}
    {state:Reviewed|approved=Published|rejected=Ready}
        {approval:Editor in Chief|user=@Editor in Chief@}
    {state}
    {state:Published|final=true|updated=Ready}
    {state}
{workflow}

Because we want our workflow to work on any space and installation, we use the confluence-users group as default and the current @user@ value reference to refer to the current user.

When the workflow is first saved, the parameters initialize with the default values; however, you can change them through the Space administration:

Only Space or Confluence administrators can change the values of Workflow Parameters.

We have a complete workflow now. Next, let's add some messaging and email notifications. Go to Lesson 4 - Adding Triggers to find out how to handle different events.

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.