I've created a state machine workflow in VS. It has two states and a task in each state. If the 2nd task is rejected I want it to restart the 1st task.

So on the rejected path of the 2nd task i've put a 'set state' to 1st task. But this appears to be ignored and the workflow moves forward instead. What could be wrong ? I want the 1st task followed by the 2nd task to run again.



Are the two states that you refer to in addition to the Initial and Completed states?

1) Make sure that you are using the Windows Workflow SetState, NOT the SharePoint Workflow SetState. (And you are setting the state to the first state, not the first task, right?)

2) Test your reject logic. If the debugger is letting you down, try using the LogToHistoryListActivity to verify the workflow - I stick them before and after every problemmatic Activity.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.