Versions Compared

Key

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

...

Excerpt
hiddentrue

Use the {increment-metadata} macro to increment major.minor.patch metadata value for a single approval using three triggers.

Overview

Different events can be used to increment a composite version number using the {increment-metadata} macro.

...

  • the choice of Major, Minor or Patch parameter value acts as a condition for one of three triggers to update the appropriate metadata version component of @current-version@ using the {increment-metadata} macro.

Use of triggers

The workflow uses the following trigger actions

...

You may need to refresh the page content to view changes in the displayed metadata values.

Workflow parameter value trigger condition

Major, Minor and Patch are workflow parameter values set as a list option choice for the workflow parameter @Update type@.

...

Once confirmed the approved transition occurs.


Composite major-minor-patch version workflow

Code Block
languagetext
themeRDark
{workflow:name=Increment a Metadata Version conditional|label=versiontest}
    {description}
    A simple approval workflow with use of increment-metadata macro to set the version of
    of approved contentand increment the version on the approval transition.
    {description}
    {pageheader}
         |Owner|@creator@|
         |Version|@current-version@|
         |Latest update|@current-type@ on @last-date@ by @last-approver@|
    {pageheader}
    {workflowparameter:Update type|description=Please, select the update type: Major (x.0.0), Minor (0.x.0), Patch (0.0.x)|type=list|options=Major,Minor,Patch|edit=true}
    {workflowparameter}
    {state:Review|approved=Approved|rejected=Rejected|taskable=true}
         {approval:Please review the content}
    {state}
    {state:Rejected|submit=Review|taskable=true|colour=#FF5630}
    {state}
    {state:Approved|final=true|updated=Review|hideselection=true|requiredparams=Update type}
   {state}
   {trigger:pagecreated}
       {set-metadata:current-version}1.0.0{set-metadata}
   {trigger}
   {trigger:statechanged|state=Review}
       {set-metadata:Update type}{set-metadata}
   {trigger}
   {trigger:pageapproved|approval=Please review the content|@Update type@=Major}
       {increment-metadata:current-version|increment=1.0.0}
       {set-metadata:current-type}Major update{set-metadata}
       {set-metadata:last-date}@date@{set-metadata}
       {set-metadata:last-approver}@user@{set-metadata}
  {trigger}
  {trigger:pageapproved|approval=Please review the content|@Update type@=Minor}
       {increment-metadata:current-version|increment=0.1.0}
       {set-metadata:current-type}Minor update{set-metadata}
       {set-metadata:last-date}@date@{set-metadata}
       {set-metadata:last-approver}@user@{set-metadata}
  {trigger}
  {trigger:pageapproved|approval=Please review the content|@Update type@=Patch}
      {increment-metadata:current-version|increment=0.0.1}
      {set-metadata:current-type}Patching update{set-metadata}
      {set-metadata:last-date}@date@{set-metadata}
      {set-metadata:last-approver}@user@{set-metadata}
   {trigger}
{workflow}


...