About Human Workflow Services support

Microsoft Office InfoPath

Show All Show All

About Human Workflow Services support

Human Workflow Services (HWS) is a service provided by Microsoft BizTalk Server 2004 that enables client applications to build and manage human-oriented workflow. Microsoft Office InfoPath 2003 provides access to this service by way of the Workflow task pane. In this task pane, users can start and track HWS actions and respond to HWS tasks. InfoPath does not provide a designer interface to enable the Workflow task pane; all HWS functionality is enabled by modifying the form definition file (.xsf).

Using the Workflow Task Pane

The Workflow task pane allows the user to start or extend a workflow or respond to a task.

The three sections of the Workflow task pane are:

  • Start Workflow Consists of the action buttons that can be used to start a workflow. This section is only visible for forms that are HWS enabled and that do not have an existing workflow associated with them.
  • Action Tracks the status of actions and their associated tasks. Once a user starts an action, the action runs and is tracked by the HWS service. InfoPath displays the status of the action and who is assigned the task.
  • Task Allows the user to work with tasks. When a task is assigned to a user, InfoPath displays the status of the task, a button to respond directly to the task, and one or more buttons to start new actions.

ShowEnabling the Workflow task pane

ShowAdding allowed actions to forms

ShowAdding allowed tasks to forms

ShowUsing the OnClick event to add action and task buttons

Creating an HWS Adapter

Because the Workflow task pane does not submit data to the HWS service automatically, you must create an HWS adapter to submit the form.

There is no designer interface associated to the submit adapters. To enable these adapters, modify the form definition file (.xsf) to include the hwsAdapter element within the dataAdapters element.

Like other InfoPath Web service adapters, the element must include a name for the adapter and the location of the Web Services Description Language (WSDL), and must specify whether the adapter allows submitting and querying. Because these adapters are only used to submit data to an HWS service, the submitAllowed attribute must be set to "yes". The queryAllowed attribute can be omitted, which corresponds to a default value of "no", or it can be included and set to "no".

As part of the design of actions and tasks, you can specify additional parameters that are specific to each action or task. Below is an example of an adapter that starts a workflow with an Approval action. The value to use for the hwsOperation element type is "addActionToNewActivityFlow". The typeID attribute uses the actionTypeID attribute value, which is a GUID.

    <xsf:hwsAdapter name="Start Approval" wsdlUrl="http://.../HWSService.asmx?WSDL" submitAllowed="yes" queryAllowed="no">
 <xsf:hwsOperation type="addActionToNewActivityFlow" typeID=”{guid}” serviceUrl="http://.../HWSService.asmx">
  <xsf:input source="HWSMessage1.xml">
    <xsf:partFragment match="/ns1:HWSMessage/ActionSection/param1" replaceWith="/my:myFields/my:param1" />
    <xsf:partFragment match="/ns1:HWSMessage/ActionSection/param2" replaceWith="/a:foo/b:bar" dataObject=”Aux1” />
  </xsf:input>
 </xsf:hwsOperation>
</xsf:hwsAdapter>

  

The hwsAdapter element has the same default interface as the other submit adapters supported by InfoPath, but the HWS submit adapters do not appear in the interface. Instead, to invoke a submit action, you must add it to your code, as shown in the following example:

    XDocument.DataAdapters.Item("Start Approval").Submit();
  

At runtime, when the submit operation is invoked, a button with the caption, Get Status, appears on the Workflow task pane. This button allows the user to refresh the task pane so that it shows the current workflow information.

ShowDefining HWS submit operations for actions

ShowDefining HWS receive operations