632 18.11 Integrating InfoPath Forms with Workflow
Forms installed into a form library are treated just like documents are in a
document library; therefore, you can use the out-of-the-box workflows to
route an InfoPath form through a workflow process simply by associating the
form library with your workflow of choice. In this instance, you can leverage
SharePoint Designer to route InfoPath forms.
The Microsoft Office SharePoint Server 2007 SDK is another great
resource to add to your workflow authoring toolkit. When you install the
SDK, you will find a whole suite of workflow templates with sample code
and forms that you can leverage in your own SharePoint workflows. It is
highly recommended that you review these templates and the associated doc-
umentation before you begin your own custom workflow development, as
you never know what treasures you may find. For example, the SDK includes
a set of Visual Studio workflow project templates specifically designed for
building SharePoint workflows. These workflow templates set up your envi-
ronment in Visual Studio by creating your folder hierarchy for deploying
your workflow, loading the SharePoint activities into the toolbox, providing
XML code snippets to aid with the creation of the Feature definition and the
element manifest XML files, and providing post-build commands and .bat
files to aid deployment. In addition, the template creates your .ddf file and
the necessary manifest.xml file required for leveraging the solution frame-
work for deploying your workflow as a solution (Figure 18.63).
18.11 Integrating InfoPath Forms with Workflow
In this section, we examine the various components of integrating InfoPath
forms with workflow. To help you better understand the concepts that we
Figure 18.63
Project files and
folder hierarchy.
18.11 Integrating InfoPath Forms with Workflow 633
Chapter 18
discuss, we recommend that you install the SharePoint Server SDK and open
up the HelloWorldSequential workflow project. The HelloWorldSequential
project is a simple example that illustrates the integration between InfoPath
and workflow. Having the project open will be helpful, because as we discuss
different aspects of the integration, you will have a point of reference and a
visual representation of the topic. Let’s begin.
You can create a number of forms for SharePoint workflows, depending
on which part of the workflow process you would like to customize. The
forms include Association forms, Initiation forms, Modification forms, and
Task forms. Association forms are the forms that administrators, or privi-
leged users, use to associate a workflow template with a specific list, docu-
ment library, or content type. Figure 18.64 shows a section of the Association
form used to associate the out-of-the-box Approval workflow with a docu-
ment library. Initiation forms are the forms presented to a user when they
want to initiate a workflow; in other words, when they want to create a work-
flow instance. Figure 18.65 shows the Initiation form of the same Approval
workflow. So what is the difference between these two forms? The Associa-
tion form is used to configure the default settings of the workflow before it is
instantiated. Data, such as the list of participants, can be captured and pro-
vided to the Initiation form for further processing.
Modification forms are forms with which a user can modify the work-
flow after it has been initiated. For example, if we look again at the out-of-
the-box Approval workflow, it has an associated Modification form that
allows a user to add additional approvers to the workflow process while the
workflow is actually running (Figure 18.66). Finally, the Task form type is a
special type of form used to manage the workflow tasks created in the task list
during the workflow process. For example, if a user edits an item in the
workflow task list, they are presented with a corresponding Task form, and
they can use this form to make changes to the workflow item (Figure 18.67).
When navigating to each of the aforementioned forms in the browser, you
will notice that the URL references an ASPX page each time. Association forms
use the CstWrkflIP.aspx page, Initiation forms use the IniWrkflIP.aspx page,
Modification forms use the ModWrkflIP.aspx page, and Task forms use the
WrkTasIP.aspx page. Figure 18.68 shows the element manifest for the Approval
workflow which contains three attributes (
AssociationUrl, Instantiation-
Url
, and ModificationUrl) that inform SharePoint which custom ASPX
page to use for a given stage in the workflow. The
MetaData element in the ele-
ment manifest contains attributes that define the URN for the InfoPath forms
to be loaded at each stage. The
Association_FormURN attribute contains the
URN of the InfoPath form to be used as the Association form; the
Initiation_FormURN attribute contains the URN of the InfoPath form to be
used as the Initiation form; the
Modification_GUID_FormURN attribute con-
tains the URN of the InfoPath form to be used as the Modification form; and

Get Microsoft SharePoint 2007 Technologies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.