File: inconAboutHWS_HV01109266.htm

package info (click to toggle)
office2003-schemas 1.0%2Bds-1
  • links: PTS, VCS
  • area: non-free
  • in suites: bookworm, forky, sid, trixie
  • size: 42,304 kB
  • sloc: javascript: 2,429; makefile: 29
file content (80 lines) | stat: -rw-r--r-- 17,495 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<html dir="ltr"><head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META HTTP-EQUIV="assetid" CONTENT="HV01109266"><META NAME="lcid" CONTENT="1033"><title>About Human Workflow Services support</title><link rel="stylesheet" type="text/css" href="office10.css"><script type="text/javascript" language="Javascript" src="ExpCollapse.js"></script><script type="text/javascript" language="JavaScript" src="inline.js"></script></head><body><p id="ExpandAllLine" class="ExpFav"><a href="#" onclick="ExpandAll()" onkeypress="ExpandAll()" class="DropDown"><img id="picHeader" border="0" src="expandtri.gif" alt="Show All"><span id="ExpandAll">Show All</span></a></p><h1>About Human Workflow Services support</h1><div class="ofvbanav"><span class="ofvbanavreuse" id="seealso" onclick="toggleList()" onkeypress="toggleList()"></span><span class="ofvbanavreuse" id="specifics" onclick="toggleList()" onkeypress="toggleList()"></span></div><p></p><p>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    <b class="ui">Workflow</b> 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  <b class="ui">Workflow</b> task pane;  all HWS functionality is enabled by modifying the <a href="#" class="glossary" onclick="AppendPopup(this,'xdformdefinitionfilexsf')" onkeypress="AppendPopup(this,'xdformdefinitionfilexsf')">form definition file (.xsf)</a>.</p><h2>Using the  Workflow Task Pane</h2><p>The <b class="ui">Workflow</b> task pane allows the user  to start or extend a workflow or respond to a task. </p><p>The three sections of the <b class="ui">Workflow</b> task pane are:</p><ul><li><b class="bterm">Start Workflow</b> 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.</li><li><b class="bterm">Action</b>  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.</li><li><b class="bterm">Task</b> 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.  </li></ul><p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">Enabling the Workflow task pane</a></p><div id="ExpCol" class="collapsed" border="0"><p>To enable the <b class="ui">Workflow</b> task pane, modify the <a href="#" class="glossary" onclick="AppendPopup(this,'xdformdefinitionfilexsf')" onkeypress="AppendPopup(this,'xdformdefinitionfilexsf')">form definition file (.xsf)</a> to include the <b class="bterm">hwsWorkflow</b> element, as follows:  
</p><pre><code>&lt;hwsWorkflow taskpaneVisible=”yes”&gt;
 &lt;location url="http://test/hwsservice/hwsservice.asmx"/&gt;
 &lt;allowedActions&gt;
  &lt;action name=”approval” actionTypeID=”{guid}” canInitiateWorkflow=”yes” caption=”Get Approval”/&gt;
  &lt;action name=”delegate” actionTypeID=”{guid}” canInitiateWorkflow=”no” caption=”Delegate”/&gt;
 &lt;/allowedActions&gt;
 &lt;allowedTasks&gt;
  &lt;task name="getManagerApproval" taskTypeID="435" caption="Send Response"/&gt;
  &lt;task name="getVPApproval" taskTypeID="436" caption ="Send Response"/&gt;
  &lt;task name="delegateToManager" taskTypeID="420" caption="Respond"/&gt;
 &lt;/allowedTasks&gt;
&lt;/hwsWorkflow&gt;</code></pre></div><p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">Adding allowed actions to forms</a></p><div id="ExpCol" class="collapsed" border="0"><p>An HWS service may provide  many different actions, but the <a href="#" class="glossary" onclick="AppendPopup(this,'xdform')" onkeypress="AppendPopup(this,'xdform')">form</a> may not require every action provided by the service.  Each action must be separately enabled for the form; thus, the form can include a subset of the actions deployed  on the HWS service.</p><p>Available actions are represented in the <b class="ui">Workflow</b> task pane as buttons,  depending on the state of the document within the workflow and the user’s permissions as defined in the HWS constraint system.

In the <a href="#" class="glossary" onclick="AppendPopup(this,'xdformdefinitionfilexsf')" onkeypress="AppendPopup(this,'xdformdefinitionfilexsf')">form definition file (.xsf)</a>, list the enabled actions, identified by their <b class="bterm">actionTypeID</b> attributes.  If the action can initiate  a workflow, the <b class="bterm">canInitiateWorkflow</b> attribute should be set to "yes".  Use the <b class="bterm">caption</b> attribute  to provide a display name for the button label of the action.
</p><p><b class="bterm">Note</b> InfoPath allows users to start only one new action based on the current state.  The <b class="ui">Workflow</b> task pane does not allow users to start multiple actions from a given state because of the way InfoPath tracks the history of an instance of a  document. InfoPath associates each instance of a document to a workflow by one  <b class="bterm">taskTypeID</b> or one <b class="bterm">actionTypeID</b>.   The workflow is considered complete when the activity flow reaches the inactive state. </p></div><p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">Adding allowed tasks to forms</a></p><div id="ExpCol" class="collapsed" border="0"><p>Tasks are mini-actions that define the work that needs to be completed by a user.  A task is assigned to a user by the HWS service  on the basis of the logic set in the action and the task parameters.  An action can be designed to assign multiple tasks, serially or in parallel.  In most cases, the action expects a task response from a user in order to continue the workflow.

 If the InfoPath form is associated with a task, the <b class="ui">Workflow</b> task pane exposes the task assigned to the user in the form of a button.  However, if the task status is set to <b class="ui">Deferred</b>, <b class="ui">Declined</b>, or <b class="ui">Cancelled</b>, the task buttons will not appear, even if the activity flow is active. Like actions,  each task must be enabled for the <a href="#" class="glossary" onclick="AppendPopup(this,'xdform')" onkeypress="AppendPopup(this,'xdform')">form</a>.  The <b class="bterm">taskTypeID</b> attribute identifies the <a href="#" class="glossary" onclick="AppendPopup(this,'xdnamespace')" onkeypress="AppendPopup(this,'xdnamespace')">namespace</a> of the task and is unique for each task.  The <b class="bterm">caption</b> attribute is used to provide a display name for the button label of the task.</p><p><b class="bterm">Note</b> Because the <b class="ui">Workflow</b> task pane does not allow you to add more properties and customize controls, use a custom task pane to display more information about the workflow.  To use the <b class="bterm">hwsAdapter</b> element without showing  the <b class="ui">Workflow</b> task pane provided by InfoPath,  set the <b class="bterm">taskpaneVisible</b> attribute to "no".</p></div><p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">Using the  OnClick event to add action and task buttons</a></p><div id="ExpCol" class="collapsed" border="0"><p>The <b class="ui">Workflow</b> task pane displays actions and tasks in the form of  buttons.   Button functionality  must be defined in the form code by adding an <b class="bterm">OnClick</b> event for every enabled action and task.  Use code to, for example, switch views, switch task panes, or submit directly to the HWS Web service.   Use the name of the action or task as defined in the <b class="bterm">hwsWorkflow</b> element of the <a href="#" class="glossary" onclick="AppendPopup(this,'xdformdefinitionfilexsf')" onkeypress="AppendPopup(this,'xdformdefinitionfilexsf')">form definition file (.xsf)</a>, as shown in the following example:</p><pre><code>function approval::OnClick(eventObj)
{
 // Switch view that contains Action/Task parameters with submit button.
}
</code></pre></div><h2>Creating an HWS Adapter</h2><p>Because the <b class="ui">Workflow</b> task pane does not submit data to the HWS service automatically, you must create an HWS adapter to submit the form.</p><p>There is no designer interface associated to the submit adapters.   To enable these adapters, modify the <a href="#" class="glossary" onclick="AppendPopup(this,'xdformdefinitionfilexsf')" onkeypress="AppendPopup(this,'xdformdefinitionfilexsf')">form definition file (.xsf)</a> to include the  <b class="bterm">hwsAdapter</b> element within the <b class="bterm">dataAdapters</b> element.</p><p>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 <b class="bterm">submitAllowed</b> attribute must be set to "yes". The <b class="bterm">queryAllowed</b> attribute can be omitted, which corresponds to a default value of "no", or it can be included and set to "no".</p><p>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 <b class="ui">Approval</b> action.   The value to use for the <b class="bterm">hwsOperation</b> element type  is "addActionToNewActivityFlow".  The <b class="bterm">typeID</b> attribute uses the <b class="bterm">actionTypeID</b> attribute value, which is a GUID.
 

</p><pre><code>&lt;xsf:hwsAdapter name="Start Approval" wsdlUrl="http://.../HWSService.asmx?WSDL" submitAllowed="yes" queryAllowed="no"&gt;
 &lt;xsf:hwsOperation type="addActionToNewActivityFlow" typeID=”{guid}” serviceUrl="http://.../HWSService.asmx"&gt;
  &lt;xsf:input source="HWSMessage1.xml"&gt;
    &lt;xsf:partFragment match="/ns1:HWSMessage/ActionSection/param1" replaceWith="/my:myFields/my:param1" /&gt;
    &lt;xsf:partFragment match="/ns1:HWSMessage/ActionSection/param2" replaceWith="/a:foo/b:bar" dataObject=”Aux1” /&gt;
  &lt;/xsf:input&gt;
 &lt;/xsf:hwsOperation&gt;
&lt;/xsf:hwsAdapter&gt;
</code></pre><p>The <b class="bterm">hwsAdapter</b> 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:</p><pre><code>XDocument.DataAdapters.Item("Start Approval").Submit();</code></pre><p>

At runtime, when the submit operation is invoked, a button with the caption, <b class="bterm">Get Status</b>,  appears on the  <b class="ui">Workflow</b> task pane.  This button allows the user to refresh the task pane    so that it shows the current workflow information.</p><p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">Defining HWS submit operations for actions</a></p><div id="ExpCol" class="collapsed" border="0"><p>InfoPath provides three types of submit operations that interact with the HWS  service:</p><p><ul><li>addActionToNewActivityFlow</li><li>addActionToActivityFlow</li><li>sendTaskResponse</li></ul></p><p> To use the HWS submit adapter, XML instances must be defined for each action.  The XML instances are defined  by using the BizTalk editor to export the Activation XML instance of each action.  The XML instance should be named and added as an InfoPath resource in the <a href="#" class="glossary" onclick="AppendPopup(this,'xdformdefinitionfilexsf')" onkeypress="AppendPopup(this,'xdformdefinitionfilexsf')">form definition file (.xsf)</a>.   For the HWS submit adapters to know which XML instance to  use, the <b class="bterm">input</b> element must be updated with the name of the XML file to use, as shown in the previous example of an adapter.  This update is only required for <b class="bterm">hwsOperation</b>, <b class="bterm">addActionToNewActivityFlow</b>, and <b class="bterm">addActionToActivityFlow</b> elements. Task responses, defined by the <b class="bterm">sendTaskResponse</b> value for the <b class="bterm">type</b> attribute, do not need an XML instance, because by querying  the server with the <b class="bterm">GetTaskInfo</b> receive operation,   the HWS  service returns the XML instance used to respond to the task.  For tasks, the <b class="bterm">source</b> attribute for the <b class="bterm">input</b> element must be blank.</p><p>Each action conforms to a BizTalk Action Message schema, as shown in the following example.  This schema is used to communicate with the HWS service.  The action can include additional parameters that are specific to the action; for example, a priority and a due date.  These parameters are stored within the <b class="bterm">ActionSection</b> element of the Action Message schema, as follows:</p><pre><code>&lt;ns0:HwsMessage xmlns:ns0="http://tempuri.org/Hws_Activate_SampleDoSomething"&gt;
  &lt;HwsSection HwsMessageType="Hws_Activate"&gt;
    &lt;ActivityFlowID&gt;00000000-0000-0000-0000-000000000000&lt;/ActivityFlowID&gt;
    &lt;InitiatingActor&gt;Contoso\johndoe&lt;/InitiatingActor&gt;
    &lt;ActionTypeID&gt;00000000-0000-0000-0000-000000000000&lt;/ActionTypeID&gt;
    &lt;ActionInstanceID&gt;00000000-0000-0000-0000-000000000000&lt;/ActionInstanceID&gt;
    &lt;ActionInstanceDescription&gt;D&lt;/ActionInstanceDescription&gt;
    &lt;ParentActionInstanceID&gt;00000000-0000-0000-0000-000000000000&lt;/ParentActionInstanceID&gt;
    &lt;ParentTaskID&gt;00000000-0000-0000-0000-000000000000&lt;/ParentTaskID&gt;
    &lt;ActivityModelTypeID&gt;00000000-0000-0000-0000-000000000000&lt;/ActivityModelTypeID&gt;
    &lt;ActivityModelInstanceID&gt;00000000-0000-0000-0000-000000000000&lt;/ActivityModelInstanceID&gt;
    &lt;ActivityModelStepID&gt;10&lt;/ActivityModelStepID&gt;
    &lt;IsDependentOnParent&gt;false&lt;/IsDependentOnParent&gt;
    &lt;ActivityFlowProperties&gt;
      &lt;Property Name="Name_0" Description="Description_1" Type="Type_2"&gt;Property_0&lt;/Property&gt;
      &lt;Property Name="Name_0" Description="Description_1" Type="Type_2"&gt;Property_1&lt;/Property&gt;
      &lt;Property Name="Name_0" Description="Description_1" Type="Type_2"&gt;Property_2&lt;/Property&gt;
    &lt;/ActivityFlowProperties&gt;
    &lt;ActionProperties&gt;
      &lt;Property Name="Name_0" Description="Description_1" Type="Type_2"&gt;Property_0&lt;/Property&gt;
      &lt;Property Name="Name_0" Description="Description_1" Type="Type_2"&gt;Property_1&lt;/Property&gt;
      &lt;Property Name="Name_0" Description="Description_1" Type="Type_2"&gt;Property_2&lt;/Property&gt;
    &lt;/ActionProperties&gt;
    &lt;HwsWebServiceUrl&gt;http://localhost/HwsService/HwsService.asmx&lt;/HwsWebServiceUrl&gt;
  &lt;/HwsSection&gt;
  &lt;<b class="bterm">ActionSection</b>&gt;
   &lt;priority&gt;1&lt;/priority&gt;
   &lt;dueDate&gt;02/19/04&lt;/dueDate&gt;
  &lt;/<b class="bterm">ActionSection</b>&gt;
  &lt;Payloads&gt;
   &lt;Payload ID="ID_0"&gt;&lt;/Payload&gt;
  &lt;/Payloads&gt;
&lt;/ns0:HwsMessage&gt;
</code></pre></div><p><a href="#" class="DropDown" onclick="Outline2()" onkeypress="Outline2()"><img border="0" src="blueup.gif" alt="Show">Defining HWS receive  operations</a></p><div id="ExpCol" class="collapsed" border="0"><p>InfoPath makes calls to the HWS service to retrieve the current workflow information and populate the <b class="ui">Workflow</b> task pane.   For every Web service call that InfoPath makes, a secondary data source should be specified to temporarily store the  retrieved data.   </p><p>The HWS Service provides four web methods that InfoPath receive operations can interact with:</p><p><ul><li>GetTaskInfo</li><li>GetActionInstance</li><li>GetActivityList</li><li>GetActivityFlowInfo</li></ul></p><p><b class="bterm">Note</b> Use the default name, as shown in the list,   for any of the secondary data connections.  The <b class="bterm">initOnLoad</b> attribute should always be set to "no."</p></div><h4></h4><script type="text/javascript" language="JScript" src="ofvbanl.js"></script><span id="ofVBAISpan" class="ofvbaispan"><iframe id="ofVBAIFrame" frameborder="0" marginheight="0" marginwidth="4" scrolling="auto" width="100%" src="../links/inconAboutHWS_HV01109266_l.htm"></iframe></span><center><a href="XMLSchemaCopyright_HV01147162.htm">&copy;2003-2004 Microsoft Corporation. All rights reserved.</a>  

Permission to copy, display and distribute this document is available at: <a 

href="http://r.office.microsoft.com/r/rlidAWSContentRedir?AssetID=XT010988631033&amp;CTT=11&amp;Origin=HV011232471033" 

target="_new">http://msdn.microsoft.com/library/en-us/odcXMLRef/html/odcXMLRefLegalNotice.asp</a></center></body></html>