When we use the state machine workflow for SharePoint 2013, we find a very unpleasant thing, that is, all of the workflow states in SharePoint are fixed, no way to show our custom status, and then after Google found that this state can be customized.
Custom Status Step
1, modify the XML add metadata the following extension;
<ExtendedStatusColumnValues>
<StatusColumnValue>测试状态1</StatusColumnValue>
<StatusColumnValue>测试状态2</StatusColumnValue>
<StatusColumnValue>测试状态3</StatusColumnValue>
<StatusColumnValue>测试状态4</StatusColumnValue>
<StatusColumnValue>测试状态5</StatusColumnValue>
</ExtendedStatusColumnValues>
Screenshot below:
2, the enumeration type that declares the custom state in the workflow;
publicenumSPWorkflowStatus
{
测试状态1 = 0,
测试状态2 = 1,
测试状态3 = 2,
测试状态4 = 3,
测试状态5 = 4,
Max = 15
}
3. In the workflow process, add the SetState item in the SharePoint workflow, as shown in the following figure;
4, in the newly added SetState item, the modification correlation is workflowtoken (same as onworkflowactivated), does not have any task the token, like above;
5, create a new state field and associated with it, the following figure;