четверг, 17 марта 2011 г.

Creating State workflows with SharePoint Designer and InfoPath


I just want to share our experience about creating quite complex workflows with SharePoint designer. 

The main problem with SPD is that you can’t create loops in your workflow – it can only proceed to next step or wait for something. This is why, for example, it is hard to implement things like custom approval workflows with SPD, as they might require returning the document to some previous state and getting additional reviews/comments.

In the internet there was an idea that you can start another workflow by creating a list item in some dummy list, and if needed you can implement some kind of looping with this technique.

We considered this as too much of unneeded customization and complications, and came to a new approach. Firs of all, you need an InfoPath form that will store 2 additional fields: ProcessState and PrevProcessState. Each action that the user makes in the InfoPath form will save the current value of ProcessState into PrevProcessState and update ProcessState to a new value.

Then you create a WF that starts every time an item is changed and create many steps that have something like “If ProcessState=XXX and PrevProcessState=YYY then …”. Using this idea you can implement any workflow you need with SPD+InfoPath. Each of this IF statements in the workflow will represent a transition between 2 states in the workflow, therefore in the end you get a way to create State Machine Workflows instead of Activity WFs. I think it is a great possibility. 

Комментариев нет:

Отправить комментарий