Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

...

Overview

A workflow parameter reference can be used to allow an applied workflow to indirectly access a value that can be set elsewhere, for example in the space tools Parameters dashboard or a workflow parameter value set by a user on the page.

One or more workflow parameters can be added to a workflow using workflow builder.

...

The workflow parameter can be set to use one of the following data types

  • character string

  • Confluence username(s)

  • Confluence groupname(s)

  • duration

  • a list of set values

Workflow parameters can be referenced in the workflow by their name wrapped in @ (at) symbols.

In the workflow markup the workflow parameter is defined by the workflowparameter macro.

Where can they be used?

You can use parameter references in the following situations:

Workflow parameter value

A workflow parameter reference

  • can be set to allow a user to edit the parameter value

  • can be added to the workflow with a default

    parameter

    value

(info) If If a default value for the workflow parameter is included in the workflow when it is first added to a space

  • the workflow parameter is added to the space tools Parameters dashboard

  • its value in the parameters dashboard can be edited by the space administrator

    the

The space parameter value will be used when the workflow is added to content. Workflow parameter references can be added to a workflow using workflow builder

If the space parameter value is changed by the space administrator this value will be used for all subsequent applications of the workflow in the space irrespective of the default value set in the workflow.

Changing the workflow parameter in the parameters dashboard does not change the default value set in the workflow template. The applied workflow checks for any workflow space parameter value when the workflow is added to a page.

Example

In the example below, a parameter called "The Message" is referenced as "@The Message@" in the body of the {set-message} macro which is triggered by transitioning to the Stop state.

Code Block
languagetextthemeRDark
{workflow:Parameter references}
   {workflowparameter:The Message}
      Default value for "The Message"
   {workflowparameter}
   {state:Start}
   {state}
   {state:Stop}
   {state}
   {trigger:statechanged|state=Stop}
      {set-message}@The Message@{set-message}
   {trigger}
{workflow}

If the workflow parameter is added as editable=true 

Code Block
{workflowparameter:The Message:editable=true}
      Default value for "The Message"
 {workflowparameter}


On the first application of the workflow to content, a user is asked to undertake some minor setup by editing the workflow parameter value.

...

Changes in the workflow parameter value

...

The value for an editable workflow parameter is changed by a user on the page

The value will be used when the next workflow event occurs that references the workflow parameter but

  • the new value may not be availablefor use by the workflow in the current state

  • the new value will then only be available for use by the workflow after a transition occurs

...

The value for an editable workflow parameter is changed by the space administrator in the 

...

...

The value will be used when the workflow is first added to content but

  • the value will not be available in the initial state of the workflow on applying the workflow

  • the value is not updated on content where the workflow is already applied

  • the value is not updated when the workflow cycles back to the initial state

The workflow parameter value may only be available for use by the workflow after a workflow process has occurred, for example, after a transition occurs from the initial workflow state.

In an approval

  • if a parameter reference Editor is used to limit the assignees for a review, the value of the parameter reference is available in the initial state of the workflow
Code Block
{approval:Check Review|selectedapprover=@Editor@,admin}

...

If a parameter reference is used to pre-assign reviewers, the value of the parameter reference will not be available in the initial workflow state. The approval will need to be added to a different state so the value is available for the workflow to use.

Code Block
{approval:Check Review|user=&@Editor@,admin}

This occurs because when a workflow is first applied to a page in as a space modeworkflow

  •  only the link to the workflow is created (and any page restrictions, if

    using 

    using same-space publishing, are applied)

  • the page (or blog post) itself won't actually transition into the initial workflow state, despite it appearing that way when you look at the workflow status bar

    .

If you look at In the Document Activity Report - Content for  for the content, you'll see that there are no workflow-specific entries listed. These pages are referred to as "unprocessed".

  • assigning a reviewer is a workflow process and it will use the workflow parameter value

  • pre-assigned reviewers will not use the workflow parameter value until after a workflow process had occurred such as a transition

Example - using an initial state to add workflow parameter values for an approval pre-assigned reviewers

...


Any changes to the workflow parameter Editor value can be made in the Initial state by a user

  • editing the value by choosing Parameters in the Workflow setup dialog box

    Image RemovedImage Added

A space admin can also change the parameter value using the space tools Parameters dashboard before any workflow activity has taken place or a user has set up the parameter value.

Choosing Initialize states in space tools Document Management dashboard can also be used to process the content and allow the workflow access to a workflow parameter value.

Related pages