Workflow Sub-actions documentation for the dotCMS Content Management System

A variety of Workflow Sub-Actions can be triggered when a Workflow Action is executed.

Built-In Workflow Sub-Actions

dotCMS includes all of the following built-in Sub-Actions. You may select any number of these Sub-Actions, and execute them in whatever order you wish, for each Workflow Action.

The Workflow Sub-Actions Pull-Down

Sub-Actions with No Parameters

The following Sub-Actions do not require (or accept) parameters. These Sub-Actions always perform the same action on the content item the Workflow Action is executed on.

Sub-Action Parameters Description
Archive content None Archives the content item.
Copy Content None Creates a copy of the content item.
  • The copy will have the same value for all fields as the original, except the Identifier and Inode.
Delete content None Deletes the content item.
Lock content None Locks the content item.
Publish content None Changes the state of the content item to Published.
Push Publish None Displays the Push Publishing popup to the user who initiated the Workflow Action.
  • This Sub-Action allows (and requires) the user who initiated the Workflow Action to select both the push method and the Environment to push to, at the time the Workflow Action is executed.
  • For a Sub-Action that performs a push without popping up a window and without requiring the user to enter any information about the push, please see the Push Now Sub-Action, below.
Reset Workflow None Resets the content item back to the initial Workflow step.
  • If the Content Type has multiple Workflows assigned to it, the content item will be taken out of the Workflow completely, so a new Workflow can be selected for the content.
Save None Saves changes to the content and creates a new version of the content.
Save as Draft None Saves changes to the content, and attempts to do so without creating a new version of the content.
  • If the user taking the action is the user that last modified the content, no new version is created.
  • If the user taking the action is _not_ the same as the user that last modified the content, a new version is created.
Unarchive content None Unarchives the content item (changing it from the Archived state to the Unpublished state).
Unlock content None Unlocks the content item.
Unpublish content None Unpublishes the content item (changing it from the Published state to the Unpublished state).

Sub-Actions with Parameters

The following Sub-Actions each accept (and may require values for) one or more parameters. The values entered for the parameters change how these Sub-Actions work, so Workflow Actions with the same Sub-Actions may behave differently, depending on the values entered for the parameters. In the list below, all parameters listed are required, unless they are explicitly marked as (Optional).

To change the parameters for any Sub-Action in this list, click the Sub-Action name in the Sub-Actions section of the Workflow Action configuration.

Sub-Action Parameters Description
'Four Eyes'
Approval
  • User IDs or Emails
  • Email Subject (Optional)
  • Email Message (Optional)
Requires that the specified number of users from among the list of specified users take the Workflow action.
  • The following Sub-actions will not be performed, and the content will not be moved into the "Next Step" specified in the Workflow Action, until the specified number of users have executed the Workflow Action.
Comment on
Workflow
  • Workflow Comment (Optional)
Adds a comment to the content item [Workflow Task](workflow-tasks).
  • If no Workflow Comment parameter is specified, the user will be prompted to enter a comment.
Link Checker
  • List of fields to check
Uses the Link Checker to verify that any links found in the specieid fields are valid.
  • If the link check on the content fails, the Subactions following the Link Checker Subaction will not be executed.
  • This means, for example, that if a Save Subaction follows the Link Checker Subaction, then if the link check fails, the content will not be saved.
Message
  • User IDs
  • Message
  • Severity
  • Life Seconds
Displays a popup message to the specified users.
  • The popup displays the specified Message for the specified number of Life Seconds before automatically dismissing.
  • The User IDs field may contain a comma-separated list of User IDs or Roles.
Notify Assignee
  • Email Subject (Optional)
  • Email Message (Optional)
  • Is Html (Optional)
Notifies all assigned users that the Workflow Action was taken.
  • If the assignee is a single user, that user will be notified.
  • If the assignee is a Role, all users assigned that Role will be notified simultaneously.
  • Any parameters which are not specified will be filled in with automatically assigned default values.
Notify Users
  • Users, Emails and Roles
  • Email Subject (Optional)
  • Email Message (Optional)
  • Is Html? (Optional)
Sends an email with the specified information and format to the specified users.
Push Now
  • Name of the Environment
  • Force Push
Push publishes the content item to the specified Push Publishing Environment.
  • The acceptable values for the Force Push parameter are true or false.
  • This Sub-Action will not display a popup to the user who executes the Action, and the content item will be pushed to publish immediately on the target environment, with no option to set the publish date or to remove the content from the target enironment.
    • For a Sub-Action that allows the user to Push Remove, set the push parameters, and select the target Environment, please see the Push Publish Sub-Action, above.
Reindex content
  • Optional Index Policy
Reindexes the content the Workflow Action is executed on.
  • Valid values for the Optional Index Policy field are DEFER, WAIT_FOR, and FORCE.
Require Multiple Approvers
  • User IDs or Emails
  • Email Subject (Optional)
  • Email Message (Optional)
Requires that all of the specified users take the Workflow Action before the following Subactions are performed.
  • If the Workflow Action specifies a Next Step, the content will not be moved into that step until all users specified in this Subaction take this Workflow Action.
Send an Email
  • From Email
  • From Name
  • To Email
  • To Name
  • Cc Email (Optional)
  • Bcc Email (Optional)
  • Email Subject
  • Email Body
  • Condition (Optional)
  • Attachments (Optional)
Sends an email with the specified content to the specified list of users.
  • If any of the Subaction parameters are not filled in, they will be left blank in the email sent (they will not be filled in with default values).
Set Value
  • velocityVar Name
  • Value to set
Sets the value of the specified field in the content item to the specified value.
  • The velocityVar Name must match the Velocity variable name of a field in the content.
  • The Value to set may be plain text or Velocity code.
  • The value of the content field will not be updated on the content editing screen unless the changed value is saved (by following this Subaction with a "Save content" or "Save Draft" Subaction).
Translate Content
  • Translate to
  • Translate Field Types
  • Ignore Fields (Optional)
  • Service API Key
Automatically translates all specified fields types of the content item to the specified languages using the Google Translation API.
  • Although this Subaction does perform basic translations, it is intended only as an example of how to perform translation actions automatically from within your workflow.
    • To perform professional translations from within your Workflow, it is recommended that you create a Custom Workflow Action Plugin to integrate dotCMS with a professional translation service.
    • The open-source code which implements this Sub-Action is available in the dotCMS Github Repository, and can be used as a template for building your own translation Subaction.
  • You must apply for and use your own unique Google Translate API key when using this Subaction.
Velocity Script
  • Script Code
  • Result Property Name
Executes the specified Velocity code.
  • The Velocity code is executed silently (no messages or popups are displayed to the user executing the Action).

Execution Order

When the Workflow Action is executed by a user, each of the Sub-Actions assigned to that Action are triggered, in the order the Sub-Actions are listed in the Action configuration.

This means, for example, that if a Sub-Action changes a value in the content item, that Sub-Action must be followed by a “Save content” or “Save Draft content” Sub-Action, or the changes made by the first Sub-Action will not be saved to the content item. Similarly, if a Push Publish Sub-Action comes before a Save Sub-Action in the Sub-Action list, then the old version of content will be pushed, before the changes to the content are saved.

Stopping Sub-Action Execution

If any of the Sub-Actions fails or encounters an error, execution of the Sub-Actions stops, and all Sub-Actions which follow the failed Sub-Action will not be executed. In addition, if any of the Sub-Actions fail, then the Next Step property of the Action will not be executed, and the Workflow Step of the content item will not be changed.

For example, when using the 'Four Eyes' Approval Sub-Action, this Sub-Action is specifically designed to stop execution of the Sub-Actions unless the required number of users has taken the action. This means that when using this Sub-Action, you can set the Next Step property of the Action, and add additional Sub-Actions after the 'Four Eyes' Approval Sub-Action, and none of those will be executed until all the required users have taken the action.

Sub-Action Permissions

Permissions are always checked for all Sub-Actions. Specifically, the permissions of the user executing the Workflow Action are always checked, for all Sub-Actions that are part of the Action, in relation to the content item the Workflow Action is being executed against, and, if applicable, any other objects in the system that any of the Subactions may access (such as content or objects accessed via the Velocity Script Sub-Action).

This means that, regardless of which users are able to execute the Action (via the Action properties), the user's permission on the content item will still always be checked and enforced for each Sub-Action.

Custom Sub-Actions

In addition to the built-in Sub-Actions, you may create Workflow Actions which have custom Sub-Actions in one of two ways:

  1. Implement custom behavior via the Velocity Script Sub-Action.
  2. Create your own custom Sub-Actions by using an OSGI plugin to create a Custom Workflow Actionlet.

Note that you may also add custom code and behavior to a Workflow Action using the Custom Code field in the Action properties. However code in this field is not executed in the same way as code within Sub-Actions; for more information on when and how different types of code is executed within a Workflow Action, please see the documentation.