Friday, February 13, 2009

Change workflow status in sharepoint.


Below is the step to change workflow status during developement.
(1) Add following attribute in the web.config file.

<ExtendedStatusColumnValues>
<StatusColumnValue>Rejected By Executive</StatusColumnValue>
<StatusColumnValue>Rejected By System Owner</StatusColumnValue>
</ExtendedStatusColumnValues>

(2) add namespace shaerpoint.workflow in top.
(3) Add Set state in the workflow templete.
(4) create set state methode and add following code.
setState1.State = (int)SPWorkflowStatus.Max + 1;

here (int)SPWorkflowStatus.Max = completed (by default status of wf)
and + 1 mines “Rejected By System Owner” [see above StatusColumnValue]