开发VS2005+sharepoint2007+infopath2007
首先你的自定义列表中有两个field,指定一级审批者(StaticName为FirstApprover)和二级审批者(StaticName为SecondApprover)
用户提交(TASK0)提交给 TASK1,TASK1可以退单给TASK0,Task0可以选择退单结束流程,Task1可以提交给Task2,Task2可以审批通过结束流程,也可以退单给Task1
大部分逻辑参考http://book.51cto.com/art/200903/112253.htm,http://book.51cto.com/art/200903/112256.htm
特意注意的一个地方:
用插入外侧代码段的方法插入的 workflow.xml
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Workflow
Name="My Workflow"
Description="This workflow ..."
Id="GUID"
CodeBesideClass="ProjectName.Workflow1"
CodeBesideAssembly="ProjectName, Version=3.0.0.0, Culture=neutral, PublicKeyToken=publicKeyToken"
TaskListContentTypeId="0x01080100C9C9515DE4E24001905074F980F93160"
AssociationUrl="_layouts/CstWrkflIP.aspx"
InstantiationUrl="_layouts/IniWrkflIP.aspx"
ModificationUrl="_layouts/ModWrkflIP.aspx">
<Categories/>
<!-- Tags to specify InfoPath forms for the workflow; delete tags for forms that you do not have -->
<MetaData>
<Association_FormURN>associationFormURN</Association_FormURN>
<Instantiation_FormURN>instantiationFormURN</Instantiation_FormURN>
<Task0_FormURN>taskFormURN</Task0_FormURN>
<Modification_GUID_FormURN>modificationURN</Modification_GUID_FormURN>
<Modification_GUID_Name>Name of Modification</Modification_GUID_Name>
<StatusPageUrl>_layouts/WrkStat.aspx</StatusPageUrl>
</MetaData>
</Workflow>
</Elements>
而你在生成项目的时候是
sharepoint中顺序工作流生成的是CodeBesideAssem="ProjectName, Version=3.0.0.0, Culture=neutral, PublicKeyToken=publicKeyToken"
sharepoint中状态机工作流生成的是CodeBesideAssembly="ProjectName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=publicKeyToken
其他的我就不多说了,状态机工作流源码