HOW TO CREATE A WORKFLOW IN SITECORE
Photo from pexels
Originally Posted On: How to create a workflow in Sitecore (oshyn.com)
Sitecore is a powerful and dynamic platform to build on, but more than just what it can do for your site itself, Sitecore offers an array of valuable tools for the content editors of your site. One feature that is very popular, especially with larger organizations who have multiple content editors is Workflows. Workflows are easy to set up and help insure all content is approved before being posted on your site.
In this video, you’ll see how easy it can be to set up a Workflow on your site and how Sitecore’s Workbox tool can be used.
Hi, I’m Suset, a Quality Engineer at Oshyn and today I will show you how to set up Workflows for Sitecore Content Editors. I’ll show you how Sitecore workflows are implemented, what they are used for, how to move items through a Workflow, and how to use the Workbox in Sitecore. Let’s get started.
Workflows are a system that you can use in Sitecore to control when a content item is published.
A workflow is a series of states that you define.
In the example we prepared for this demo, the workflow states correspond to Draft, Awaiting Approval, Approved and content items must go through all these states before they are published on the website.
In Sitecore, you can implement any number of different workflows. Each workflow must contain at least two workflow states – one that has been defined as the initial workflow state (Draft) and one that has been defined as the final workflow state (Approved).
Workflows are normally implemented by developers. However, it is useful for content authors to understand how they are constructed and implemented.
A workflow consists of:
A Workflow — the main item that contains all of the subitems that make up the workflow.
Workflow States — the different stages in your content creation process.
Workflow Commands — the actions that must be performed to move the content items from one workflow state to another.
Workflow Actions — actions that are automatically performed on the content items when they are in particular workflow states or when particular workflow commands are executed.
After the workflow has been defined, the developer specifies which item templates are subject to the workflow.
It’s important to note that content items can only be published when they are in the final workflow state.
We are logged in as an admin, so let’s log off and log in using an editor account.
When you create a new content item, it is automatically placed in the initial workflow state. The content item remains in the initial workflow state until you use a workflow command to move it to another workflow state.
If you edit an existing content item that is subject to a workflow, Sitecore creates a new version of this content item and places it in the initial workflow state. If you edit this content item again later, you edit the version that is in the workflow unless you specify that you want to edit another version.
Keep in mind that content items that are edited by administrators are not subject to workflows.
Content items can be moved from the page editor or the Content Editor – here I’ll show you how to move content items in the Content Editor
When you have finished editing the content item, you can send it to the next workflow state.
To send a content item to the next workflow state:
1. In the Content Editor, open the content item that you are working on.
2. Click the Review tab
As you can see, the Workflow group displays a workflow command — Submit. This is the only workflow command that you can apply to the current content item in its present workflow state.
Furthermore, the content item also displays a message informing you that this version of the item cannot be published because it is not in the final workflow step.
3. Click Submit to send the content item to the next workflow state. Sitecore displays a dialog box for you to enter a comment.
4. Enter a comment and then the content item is moved to the next workflow state.
The workflow commands that are available in the Workflow group change to reflect the item’s new status.
However, if you do not have permission to edit the content item in this workflow state, you cannot lock the item for editing and the workflow commands will not be displayed.
Sitecore also contains a Workbox that has been designed to give reviewers a greater overview of all the content items that are currently in workflows.
Currently we are logged in as an author so let’s log off and log in as an approver.
When you need to review content items, you can use the Workbox to see all the content items that are currently in workflows and which workflow states they are in.
To use the Workbox:
1. Log in to the Sitecore Desktop.
2. Click the Sitecore Start button and then Workbox.
In the Workbox, you can see that the Sample Workflow has been selected and you can see all the relevant workflow states. You can also see that there is one content item in the
Awaiting Approval workflow state.
3. In every workflow state, you can preview, open, compare, each content item as well as apply the workflow commands that have been defined for that workflow state.
In the Awaiting Approval workflow state, you can approve, or reject the content item.
To preview the version of a content item that is in a workflow state, click Preview and this version of the item is displayed in a new browser window.
To open a content item, click Open and the item is opened in the Content Editor.
To see the changes that have been made to a content item, click Diff.
The Compare Versions dialog box lets you see the changes that have been made to this version of the item. You can select which versions to compare and whether you want them displayed in one or two columns.
When you are finished reviewing the content item, click Approve or Reject to move it to the appropriate workflow state.
That’ a basic overview of Sitecore’s Workflows to give you an idea of how to set them up on your site and how they can be useful to your site’s content editors. Learn more about Oshyn’s Sitecore services.