-8

According to Sitecore's official documentation in order to set a workflow for items created from a template one have to set Default Workflow in the template's standard values.

Well I did just that and... nothing is happening. More specifically all the newly created items are created without workflow fields being set. Any ideas why?

I just set the Default Workflow field on the template's __StandardValues; all other workflow related fields are left empty.

What else is needed for the Workflow to be attached to new items? Why is the workflow not being initiated?

  • 1
    The lack of detail here makes providing an answer difficult, as it stands this is not a good question. – JohnD Sep 16 '16 at 18:09
  • @JohnD what information would make this question better? You can always ask. – Szymon Kuzniak Sep 16 '16 at 23:34
  • 1
    While I provided an answer to this question, the lack of detail makes anyone wishing to answer have to assume a lot about your environment. Screenshots and details about the type/roles of user having the issue can go a long way towards helping us help you. – Pete Navarra Sep 19 '16 at 17:59
5

Are you logged in as an Admin? Admins are not subject to workflow enforcement.

| improve this answer | |
  • Just tested on Sitecore 8.2 - logged in as admin, created new template, set default workflow, created new item based on the template - it has the workflow set and the initial step as well. – Szymon Kuzniak Sep 19 '16 at 7:31
  • So items are now being created with workflow set? The workflow field are no different than any other fields in Sitecore. If you set them in __StandardValues they will be set properly on newly created items. – Richard Hauer Sep 19 '16 at 10:29
  • Yeah, but in case of workflow you can't just set the workflow and step on standard values because that would cause standard values to be a subject of workflow thus default workflow field. Now it works on clean Sitecore instance even if I am logged in as admin but does not work on my dev instance. No idea why... – Szymon Kuzniak Sep 19 '16 at 10:40
  • This is strange. I was more than sure that workflow works for admins as well (I remember having scripts to automatically move items through workflow even though I was logged in as admin). But I checked on the system I have been working on and indeed when regular user is creating items they are in the workflow. Thanks – Szymon Kuzniak Sep 23 '16 at 8:38
2

Check that the RequireLockBeforeEditing setting is set to true in your config. This is required to force items down workflow.

| improve this answer | |
2

The purpose of why Default Workflow exists is so that you can set the __Standard Values of a template to a workflow, without putting the __Standard Values in workflow itself.

Items created by non-admin users based on a template where Standard Values Default Workflow item is set to an active workflow, will create the item, setting the Workflow field equal to the default workflow value.

The key here is that this doesn't happen if the user creating the item is an admin.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.