Workflows
CMS workflows help coordinate more complex activities and facilitate team collaboration around content management. SAP Commerce Cloud provides two sample workflow templates for content review and approval: Page Approval and Page Translation and Approval.
Overview
SAP Commerce Cloud provides two default CMS content workflow templates for content editing, reviewing, and publishing:
- Page Approval
- Page Translation and Approval
Content management team members use CMS content workflows to ensure that new and edited content is published only after they’ve reviewed and approved it. Workflows are based on workflow templates. In order for content management team members to apply a workflow to a page, its workflow template must be enabled for the content catalog version that the page belongs to. The page approval workflow template is enabled for the staged content catalog of the Apparel UK Accelerator storefront. The page translation and approval workflow template is enabled for the staged content catalog of the Electronics Accelerator storefront. Once the content management team reviews and approves the content for these storefronts, the workflow completes successfully and SmartEdit automatically publishes the pages to the active version of the content catalog.
The Apparel DE and Powertools storefronts don’t have any CMS content workflow templates enabled for them. You must manually change the status of new or edited pages of these storefronts before you can synchronize content to the active versions of their content catalogs. You can synchronize content by synchronizing the associated page or catalog. Synchronization jobs are configured to synchronize approved pages only.
Workflow Permissions
Permission checking for types and attributes is disabled by default. Only authorized users can apply a workflow to a page or perform tasks within a workflow. SmartEdit verifies the permission.checking.all.types.enabled and permission.checking.all.attributes.enabled properties to verify if a user has the required permissions. By default, these properties are set to false, so that users don't have permissions for workflows. To automatically assign workflow permissions to users or usergroups, you must set the permission.checking.all.types.enabled property to true.
For more information about permission checking, see Configuring Permission Checking.
APIs
The Workflow API provides the services, facades, interceptors to support workflows. It makes it possible for SmartEdit to retrieve workflows, verify if users can edit items in workflow actions, or block users from editing items in active workflows. It also provides services to display modal forms for users to perform workflow actions. It provides the following APIs and their associated endpoints:ccc
- CMS Workflow API: Creates and starts workflow instances, as well as edits workflow metadata.
- CMS Workflow ActionAPI: Retrieves workflow action information, as well as retrieves workflow comments associated to a specified workflow action.
- CMS workflow operation API: Cancels a running workflow instance, such that all pending workflow actions are aborted and the workflow is terminated. It also supports creating a decision object for a specified workflow action.
- Workflow Template API: Retrieves workflow template information.
CMS Content Workflow Templates
SAP Commerce Cloud provides the functionality for you to create workflow templates, such as actions and decisions. CMS content workflow templates are catalog-aware, that is, they’re templates that you associate with a content catalog version. A new relation between WorkflowTemplate and CataloVersion types was created to support catalog-aware workflow templates. You can apply only catalog-aware workflow templates in SmartEdit. You can enable workflow templates for the active version of a content catalog. You should enable templates only for the nonactive version of a content catalog to ensure that you publish only reviewed content to your live storefront.
For more details about the CMS content workflow templates configuration and catalog-aware relation definitions, see CMS Content Workflow Templates.
For more details about the workflow support in SAP Commerce Cloud, see the following:
Page Approval Status Management
SmartEdit maps page approval status management to page status management in the front end. Page status management provides user-friendly labels to inform users of the status of their pages so that they can perform the appropriate action on the page.
- Draft is displayed when the page approval status is CHECK.
- Ready to Synch is displayed when the page approval status is APPROVED, but the page is out-of-sync or has never been synched.
- Synched is displayed when the page approval status is APPROVED and the page is synched.
The following code excerpt taken from the cms2/resources/cms2-items.xml file shows that the page approval status can be CHECK or APPROVED:
<enumtype code="CmsApprovalStatus" autocreate="true" generate="true"> <value code="check" /> <value code="approved" /> </enumtype>
Manually Changing the Status of a Page
When you create a page or edit an existing one, SmartEdit sets the page approval status to CHECK. In the interface, SmartEdit displays the status as Draft. If you don't use workflows or don't want to apply a workflow to the page, you can manually change the status in SmartEdit from Draft to Ready to Sync. SmartEdit changes the page approval status to APPROVED.
If you have an approved page that you haven’t yet published and you no longer want to publish, you can manually change its status from Ready to Sync to Draft in the SmartEdit interface. The page approval status is set to CHECK.
Automatically Changing the Status of a Page
When you edit a page, its page approval status is automatically updated to CHECK. Setting a page approval status to CHECK ensures that only reviewed and approved pages are available in the online version of the content catalog. It also ensures that you apply CMS content workflows to new or modified pages. For information on how SmartEdit detects changes in the page approval status of a page, see Changing the Status of a Modified Page to CHECK.
Locking Items from Editing
SmartEdit locks items from editing based on specific criteria, such as:
-
When an item associated to an active workflow and the current user isn’t assigned the current task of the workflow or the current user isn’t a member of the user group that is assigned the current task in the workflow.
-
When the current user doesn’t have permission to edit the item.
When SmartEdit locks an item, it displays the editor in read-only mode. The user can view the information but can’t edit it. To verify if the item is associated to an active workflow, SmartEdit makes a request to the Workflow Editable Items API. For more information, see Verifying if CMS Items are Editable in Workflows.
Inbox, Announcements, and Workflow Tasks
When a page is in an active workflow, SmartEdit displays a workflow menu called Workflow Tasks. The menu consists of two tabs: Current and All. The Current tab displays the currently active task. The All tab displays all tasks in the currently active workflow and indicates their status. You can only execute a task in a workflow if you have the correct permissions and if you’re a member of the user group that the task is assigned to. SmartEdit notifies you of pending tasks in active workflows through announcements. The announcement service displays announcements in the upper left of the navigation toolbar. It displays the announcements as the tasks become active. SmartEdit also indicates active tasks in the Inbox. SmartEdit indicates the number of tasks beside the Inbox. When you open the Inbox, SmartEdit displays the task. When you select a task, SmartEdit jumps to the page with the active workflow.