This site has moved to the integrated Appfire documentation and information site for our apps.

From February 2024 this site is no longer updated.

Take a look here! If you have any questions please email support@appfire.com

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

« Previous Version 20 Current »

Overview

Use the set-message macro to display an on-screen message.

It's great for keeping the user informed during the content production process when a workflow event or change occurs.

  • messages are shown between the page title and body content whilst viewing content (it's hidden from the edit screen)

  • messages can be configured as different panel displays - info, error, warning, success

  • if triggered by stateexpired or taskexpired events, the message won't be shown until the page is refreshed

The set-message macro can be filtered to display the message only to a specific user(s).

A message filtered to display to a specific user includes an option for the user to remove it.

Messages filtered for users are removed after the user has viewed the message.

Messages can also be filtered using the view parameter to display a message on the workflow draft content URL or the workflow published content URL when the applied workflow has a final state.

The message is removed and replaced when a new trigger event occurs that includes a new set-message action macro (if the message is for the same audience). The message will be cleared if the empty set-message macro in the trigger is empty.

Where to use it?

Optional.

One or more set-message macros can be added as action macros in a trigger macro.

{trigger:statechanged|state=Rejected}
        {set-message}
        The page content has been rejected. The content must be triaged.
        {set-message}
{trigger}

A filter can be added to display the message to specific audiences - for example to one or more users, one or groups

{trigger:statechanged|state=Draft}
        {set-message:user=@user@}
        The page content has been moved to the Draft state. The content must be triaged before submitting for approval.
        {set-message}
{trigger}

If more than one set-message macro is added to a trigger

  • only one message will be displayed on the page if all the messages are for everyone (unfiltered)

  • more than one set-message macro in the trigger will be displayed on the page if at least one of them is filtered to be displayed to a user(s), group(s) or the draft/published content

Parameters

Parameter

Required

Default

Notes

Ver

unnamed first parameter

DEPRECATED Use the user parameter instead.

Deprecated v5.2

macro body



The message to display:


Replaces an existing message to the same audience; if the macro is empty, the message panel will be removed for that audience.

{set-message}{set-message}

A message that included view=draft would require the empty macro to be configured with the same parameter to remove the displayed message.

{set-message:view=draft}{set-message}

duration


(info)

How long should the message be displayed from the point at which it is set?


(info) Default behavior depends on message audience:

  • unfiltered messages are shown indefinitely

  • if a group and/or user is specified, the message for an individual user will expire once viewed by that user

In both cases, specifying a duration will override the default behavior.

group


unfiltered

Only show to users in specific user group(s)?

The message for an individual user will expire once viewed by that user. It will not be displayed for subsequent views of the page or if a transition has occurred before viewing.

The on-screen display of a message filtered to a specific group(s) can be removed from the screen for that member of the group using an X option displayed in the message panel.

The option to remove the message is not displayed if a duration parameter value is added to the macro.

Filter by label

There are no items with the selected labels at this time.

5.2

style


info



Message style: info, error, warning, success

o

o

o

o

if no style is added the default message display is info.

4.1

OBSOLETE The tip and hint styles are no longer supported (since v4.1) – use success and info, respectively, instead.

user


unfiltered

Only show to specific user(s)?

The message for an individual user will expire once viewed by that user. It will not be displayed for subsequent views of the page or if a transition has occurred before viewing.

The on-screen display of a message filtered to a specific user(s) can be removed from the screen for that user by using an X option displayed in the message panel.

The option to remove the message is not displayed if a duration parameter value is added to the macro.

Filter by label

There are no items with the selected labels at this time.


view


both

Which types of content URL should the message be shown on?

Default - no inclusion of the parameter or value. The undisplayed parameter default value is both.

  • draft – the normal URL

  • published – the /public URL

  • both – both normal and public URLs

When view=draft or view=published is included the set-message macro the message is considered as a filtered message and can be used in the same trigger as an unfiltered set-message macro (the view parameter is default value of both)

Filter by label

There are no items with the selected labels at this time.

5.2

This parameter determine which URL the message will be shown on when using same-space publishing:

If you're not using same-space publishing, all users see the normal URL by default.

For example,

If view=draft, the message is displayed when viewing the content in any state in the workflow

  • myconfluence.com/display/MSRM/Our+Page

But this message is not displayed when viewing the last approved version for a page with an applied workflow that includes a final state. The viewer will see this content URL with the /public pathway

  • myconfluence.com/public/MSRM/Our+Page

The filtered message view=draft will be displayed on content in the final workflow state. The content in the final state has the normal URL and not the /public URL

(info) 

The user and group parameters can be used together:

  • groups are treated as if you listed their users via the user parameter

  • there can be only one message for a given user per view type

Unfiltered messages, those which do not specify user or group, are treated separately:

  • they will be shown in addition to user or group messages

Removing a message

An empty set-message macro body in a trigger can be used to remove a previously set message.

{set-message} {set-message}

You need to use the same parameters that are in the message you want to remove, for example, if the set-message macro contained view=draft, then, your empty set-message macro must have the very same view=draft parameter.

For example, adding the following message on a state transition

{trigger:statechanged|state=Test}
        {set-message:style=success}
        You transitioned to the "Test" state
        {set-message}
{trigger}

This can be removed in a subsequent transition using an empty set-message macro in the trigger.

{trigger:statechanged|state=Ready}
        {set-message}
        {set-message}
{trigger}

Although the set-message macro included a parameter to define the style of the message, both this set-message macro and the empty set-message macro are unfiltered - they are displayed to the same audience - and the message is removed.

The unfiltered set-message macro display is persistent until either removed using an empty set-message macro or will be replaced if another trigger actions a message using an unfiltered set-message macro.

If you have the following two messages displayed - one filtered using view=draft and one unfiltered - they are considered as being for different audiences.

{trigger:statechanged|state=Draft}
        {set-message:view=draft|style=info} This is draft content, an approved version has been published{set-message}
        {set-message:style=warning} This content must be triaged and reviewed{set-message}
{trigger}

Using the following in a trigger will only remove the unfiltered warning message.

{set-message} {set-message}

To remove both messages the trigger will need to include an empty set-message macro for each different audience.

{trigger:statechanged|state=Published}
        {set-message}{set-message}
        {set-message:view=draft}{set-message}
{trigger}

Removing a workflow

If an applied workflow is removed from content

  • any displayed set-message macro messages are removed from the document.

If the workflow is removed without clearing the document activity

  • previous on-screen messages will be displayed on reapplying the workflow (if the state has not been initialized)

Examples

Adding a filtered set-message macro and an unfiltered set-message macro to the same trigger

{workflow:set message test workflow}
    {state:Test}
    {state}
    {state:Ready}
    {state}
    {trigger:statechanged|state=Test}
        {set-message}
        This message shown to everyone
        {set-message}
        {set-message:user=@user@}
        You transitioned to the "Test" state
        {set-message}
    {trigger}
    {trigger:statechanged|state=Ready}
        {set-message}{set-message}
    {trigger}
{workflow}

A transition to the Test state adds two on-screen notifications to the page.

The message from each set-message macro are both displayed as they are considered to be for different audiences

  • at least one of the macros is filtered using an added user parameter value or group parameter value

  • unfiltered messages are shown in addition to any messages filtered to users

The second message is specific to the user who actioned the transition and is only displayed to this user. This message can be removed by the user using the X option in the message.

Adding one or more unfiltered set-message macros to the same trigger

If a trigger has two or more set-message macros with no filter (no user, group or view parameter added to any of the macros).

{trigger:statechanged|state=Test}
        {set-message}
        Hey, this page needs some triage work!
        {set-message}
        {set-message:style=success}
        You transitioned to the "Test" state
        {set-message}
    {trigger}
  • only the last set-message macro content before the closing trigger will be the message displayed on the page on the transition

The first set-message macro action in the trigger is superseded by the second set-message macro.

In this example the set-message macro is a success panel as the parameter style=success has been added to the macro.

Only the last set-message macro before the closing trigger will be displayed if you add two or more filtered set-message macros with the same user or group filter to the same trigger,

All examples

See also

Workflow Authoring Guide:

  • No labels