Sunday, November 25, 2018

Workflows in sitecore and Content approval using Workflows

Hi All, welcome back, In this post we will see about workflows in sitecore and content approval using workflows.

Let's Move,
  • Workflows are used to restrict your content author to create right items for your sites.
  • Basically workflow is a series of steps that an item version goes through from it’s creation to it’s publication.


It has three basic parts

1. States

  • The basic building blocks of the workflow. The workflow states represent the different stages in your content creation process.
  • State must have(One initial State and one or final states)

2. Commands

  •  Transition of content items from one workflow state to another that is defined in the command item.

3. Actions

  •  An automatic side-effect of a command or entering a site. 


Example of content approval using Workflows and mail the details: 


Step 1: Create a Workflow from a path /sitecore/system/Workflows/ and name this as TestWorkflow.




Step 2: Create three states named as Initial,Editing and Approved.




Step 3: Create a one command under initial state named as Created
            And create two commands named Approved,Reject Under Editing
 Copy the auto publish item to Approved state from the example workflow




  

Click the TestWokflow and provide initial state to Inital state field
For ex.



And also click the created command item and set next state to Editing and click the approved command item and set next state to Approved ,and in the reject command item set Inital state in the next state field.
For ex.



Click the Approved state and check the mark as final field(this the last state that your item goes).



Create a mail Template based on a Template Sitecore/Templates/System/workflow/Email action in the Approved state.

Step 4: fill the necessary fields that you want and put your custom class path that have logic to send mail in the Type field







Step 5: In the class,using WorkflowPipelineArgs, I have rendered all fields and sent mail to provided email.






Step 6: Create a template named as test, Create standard values for that template,and assign your workflow in the default workflow field from workflows tab(Don’t forget to enable Standard fields in the view tab.because it enables workflow options in the the standard values item)



Step 7: Create a item based on the template and check above the qucik info section(Item is not published because it is not in workflow state)

Step 8: To move your item to the next state
on the Review tab,find your command(created) ,clicking on this ,will move this item to next state.After final state is reached the item is auto published(because we included the auto publish item at final state and mail sent to the provided mail in the mail action item)







  

Advantages of workflows:

1.Acquire content approval
2.Prevent unwanted publishing

All now set,Please share with your friends Happy coding :)

1 comment:

  1. Great Article! Thanks for sharing the information with us. To know more details about Content Workflow Software browse the given link

    ReplyDelete

Check the users Logged into the sitecore backend

Hi, Today I'm going to discuss about " how to check the concurrent users logged into the sitecore backend ? ". For this ...