I have a "project" template, a workflow "project workflow" on that template and a lot of items created from the project template.
As a non-admin user, when I edit a project item it gets sent to workflow. That doesn’t happen if I'm logged in as admin, because admin users ignore workflow.
I have a bulk import process where I edit items via the Sitecore API:
updateItem.Editing.BeginEdit();
updateItem.Versions.AddVersion();
updateItem.Fields["x"] = someVal;
updateItem.Fields["y"] = someOtherVal;
updateItem.Fields["z"] = yetAnotherVal;
updateItem.Editing.EndEdit();
When I run this bulk import code as admin, I want my items to go through workflow so that a human is involved in approving or rejecting the items that got imported – but that doesn’t happen, because admin users ignore workflow.
Is there a way to programmatically send the items I modify to workflow? There's an Item.State.GetWorkflowState(), but there doesn’t seem to be a corresponding SetWorkflowState().