When you select the Mandatory property for a workflow, the workflow is intentionally restricted to only allow actions which are part of the workflow. Once you assign a Mandatory workflow to a Content Type, any other actions - including default actions dotCMS normally offers for all content - will no longer be allowed on any content of the Content Type.
- Restricted Behaviors
- Scope of Effects
The following actions and behaviors are restricted for Mandatory workflows, and you may receive errors if you attempt to perform these actions on any content of a Content Type assigned a Mandatory workflow:
Default Save and Publish Actions
Default standard actions such as Save, Publish, and Archive are normally available for all Content Types. However when you set a workflow as Mandatory, then these default actions will not be available for any content of a Content Type that uses that Workflow.
The only default standard actions that will continue to be available for content items assigned a Mandatory workflow are Lock and Unlock. However it is still recommended that you create specific Lock and Unlock actions within your Mandatory workflow, to ensure that appropriate permissions are checked and appropriate workflow sub-actions are taken when these actions are performed.
Saving Content via REST API
REST API commands that add and save content do so using a mechanism which is different than the actions in any custom workflow specified for a Content Type. When you set a workflow as Mandatory, the workflow only allows changes using the actions defined in the workflow, so standard actions performed via the REST API (such as adding and saving content) will fail.
However you can trigger workflow actions that are defined in the Mandatory workflow using the REST API on content which is assigned to that workflow. For more information on triggering workflow actions using the REST API, please see the Workflows section of the Save Content Using REST API documentation.
Content Search Screen
Selecting Multiple Items
The Content Search screen displays a check box next to each content item displayed, and displays several buttons along the bottom of the screen, including but not limited to Publish, Unpublish, Archive, and Unlock. For content items of Content Types with non-Mandatory workflows, you can select multiple items via the checkboxes, and then press any of the buttons along the bottom to take the appropriate action on all checked content items at once.
However when you assign a Mandatory workflow to a Content Type, you may no longer select items of that Content Type in the Content Search screen; the checkboxes for items of that Content Type will be grayed out, and the only way you will be able to perform actions on those content items is by taking actions on them one at a time (either from the content editing screen or using the right-click menu.
Actions in the Right-Click Menu
For Content Types assigned a non-Mandatory workflow, the options available in the right-click menu on the Content Search screen will be the same default actions available via the buttons across the bottom of the screen. However when you assign a Mandatory workflow to a Content Type, the right-click menu for those content items is changed to display actions from the assigned workflow instead.
Note that only some workflow actions will display in the right-click menu. For a workflow action to display in the Content Search screen right-click menu, it must meet all of the following criteria:
- The content item must be in the appropriate Workflow step for the action.
- The current use must have permission to use the Workflow action.
- The Workflow action must not require that the content be locked.
- If the Workflow action requires the content to be locked, the workflow action will not display in the right-click menu, even if the current user has locked the content item.
Scope of Effects
It's important to understand that when you make a Workflow Mandatory, the workflow and all actions in it are always Mandatory. You can not make only some steps or actions of a workflow mandatory, and you can not make a workflow mandatory for some Content Types and non-mandatory for other Content Types.