Azure, Open Source, SharePoint and ...

Setting Workflow Status to custom value

To set the Workflow status to a custom value add your custom Status values to workflow.xml under <MetaData>:

 <StatusColumnValue>Failed Verification</StatusColumnValue>

Using SetState activity and SPWorkflowStatus you can set the status programmatically as follows:

private void setState_MethodInvoking(object sender, EventArgs e)

    if (!this.changeApproved)
        //Set workflow status to Rejected
        this.workflowState = (int)SPWorkflowStatus.Max;
        //Set workflow status to Failed Verification
        this.workflowState = (int)SPWorkflowStatus.Max + 1;