Develop vs2005 + sharepoint2007 + infopath2007
First, your custom list contains two fields, specifying the level-1 approver (staticname is firstapprover) and level-2 approver (staticname is secondapprover)
If you submit a ticket (task0) to Task 1, Task 1 can return the ticket to task 0, task 0 can choose to return the ticket to the End Process, Task 1 can be submitted to task 2, Task 2 can approve the process and end the process, or you can return the ticket to Task 1.
Most logic reference http://book.51cto.com/art/200903/112253.htm,http://book.51cto.com/art/200903/112256.htm
A special note:
Insert workflow. XML using the method of inserting external code segments
<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 = "0x01080100c9c9515de4e24001095074f980f93160"
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>
When you generate a project
The sequential workflow in SharePoint generates codebesideassem = "projectname, version = 3.0.0.0, culture = neutral, publickeytoken = publickeytoken"
In Sharepoint, the state machine workflow generates codebesideassembly = "projectname, version = 1.0.0.0, culture = neutral, publickeytoken = publickeytoken
I will not talk about anything else. The source code of the state machine workflow.