Sharepoint Sequential Workflow with Reject RRS feed

  • Question

  • We have an already existing sharepoint sequential workflow which has only approve and cancel functionality. Client now wants us add the Reject functionality at each stage (each step for Product Mgr --> Regional Mgr --> Gen Mgr etc). We need help on implementing Reject. Would appreciate help with examples/sample code.

    So far, we tried adding If-Else with condition that If approved then go ahead with the next worflow tasks; Else - we want workflow control to go back to originator of the order (very first approver step) - we tried adding a Rollback task to acheieve this - but we are not sure how to provide the GUID of a task in the TaskID property. Also we are confused about Rollback task's exact concept - does Rollback only rollback task specified by TaskID or can it also be used to "go back" to the task specified by TaskID property??

    Please help!


    Friday, October 7, 2011 7:08 AM

All replies

  • Hi,

    Are you using Infopath form or aspx custom form for approval or cancel or sharepoint default task approval form ?

    Thanks, Ali Yasir
    Friday, November 11, 2011 2:25 PM
  • We are using infopath forms for the approve and reject.

    We also have a Delete Item linkbutton (I think it is sharepoint's inbulit) which is supposed the Delete task and kill the order. We would like to change the workflow task status to "Cancelled" or some other self-defined hard-coded string - however, we are unable to do so.

    On Reject button click, we want to do similar thing - make task completed = false and change task status to "Rejected" and if possible make task assignto = the originator of the order.

    We are unable to set hard coded strings of our choice to task status (or even re-use any Enum status already defoned for workflow) - where do the status values of tasks get set?? Don't we have any control over the task.complete, task.assignto, task.status properties?? We tried to set these values in wsstask.cs but our custom code has no effect whatsoever. The workflow tasks just continue one after another, ignoring our custom code.


    Thursday, November 24, 2011 6:35 AM
  • Hi,

    In sharepoint task rollback is not possible. Task will always be completed.

    My suggestion are:-

    • Add field of type choice with your options like Approved/Rejected etc.
    • Based on these selection by the approver, change the workflow's flow.
    • Although workflow task can't be roll backed, It always complete.


    Friday, November 25, 2011 4:39 AM