Dave wrote:
Related to this, I'd also be interested in knowing how to programmatically trigger a particular path on a Multi-choice workflow step.
I think this is what you're looking for. You could set the aliasPath parameter as an input parameter and based on what your previous code finds (success/failure) you can set the path as needed and move to a specific workflow step. This is an example out of the CMSAPIExamples
CMS.DocumentEngine.TreeProvider tree = new CMS.DocumentEngine.TreeProvider(CMSContext.CurrentUser);
// Prepare parameters
string sitename = CMSContext.CurrentSiteName;
string aliasPath = "/API-Example";
string culture = "en-us";
bool combineWithDefaultCulture = false;
string classNames = CMS.DocumentEngine.TreeProvider.ALL_CLASSNAMES;
string where = null;
string orderBy = null;
int maxRelativeLevel = -1;
bool selectOnlyPublished = false;
string columns = null;
// Get the document
CMS.DocumentEngine.TreeNode node = CMS.DocumentEngine.DocumentHelper.GetDocument(sitename, aliasPath, culture, combineWithDefaultCulture, classNames, where, orderBy, maxRelativeLevel, selectOnlyPublished, columns, tree);
if (node != null)
{
CMS.DocumentEngine.WorkflowManager workflowManager = CMS.DocumentEngine.WorkflowManager.GetInstance(tree);
CMS.WorkflowEngine.WorkflowInfo workflow = workflowManager.GetNodeWorkflow(node);
// Check if the document uses workflow
if (workflow != null)
{
CMS.WorkflowEngine.WorkflowStepInfo stepInfo = CMS.WorkflowEngine.WorkflowStepInfoProvider.GetWorkflowStepInfo("your step name", workflow.WorkflowID);
workflowManager.MoveToSpecificStep(node, stepInfo, "your comment");
}
}