API Questions on Kentico API.
Version 6.x > API > WorkflowManger.MoveToSpecificStep() View modes: 
User avatar
Member
Member
robert-tailor.co - 10/2/2012 3:11:34 PM
   
WorkflowManger.MoveToSpecificStep()
Hi,

I have programmatically created a new document, and I want to set it's workflow state to 'published'.

How do I do this?

There is a WorkflowManager.MoveToSpecificStep() method, but it requires a WorkflowStepInfo object as one of it's parameters.

How do I get the WorkflowStepInfo object for the 'published' step?

User avatar
Kentico Support
Kentico Support
kentico_radekm - 10/3/2012 1:56:18 AM
   
RE:WorkflowManger.MoveToSpecificStep()
Hello.

There is one implementation of this method which accepts TreeNode as a parameter instead of WorkflowStepInfo object. So you can try to use this implementation instead.

You can get the TreeNode object via DocumentHelper.GetDocument() method or CMS.CMSHelper.CMSContext.CurrentDocument.

If you prefer WorkflowStepInfo object, you can use CMS.WorkflowEngine.WorkflowStepInfoProvider.GetWorkflowStepInfo(int32), where "int32" represents an ID of the workflow step to retrieve.

You can also find an example at http://devnet.kentico.com/docs/devguide/index.html?workflow_advanced_api_examples_workflow_process.htm

Best Regards,
Radek Macalik