Share via


HWSAdapterObject Interface

Represents a connection to submit form information to a Microsoft Biztalk 2004 HWS (Human Workflow Services) server.

Namespace: Microsoft.Office.Interop.InfoPath
Assembly: Microsoft.Office.Interop.InfoPath (in microsoft.office.interop.infopath.dll)

Syntax

'Declaration
'Usage

Remarks

This type is a wrapper for a coclass that is required by managed code for COM interoperability. Use this type to access the members of the COM interface implemented by this coclass. For information about the COM interface, including a link to descriptions of its members, see HWSAdapter.

Use the Item property of the DataAdaptersCollection to return an HWSAdapterObject object.

Example

In the following example, the Submit method of the HWSAdapterObject is used to start an HWS workflow. This example requires a data connection called "RespondToApproval":

HWSAdapter hwsAdapter = thisXDocument.DataAdapters["RespondToApproval"] as HWSAdapter;
if (hwsAdapter == null)
{
 thisXDocument.UI.Alert("HWSAdapter 'RespondToApproval' does not exist");
 return;
}
if (hwsAdapter.SubmitAllowed)
{
 try
 {
  hwsAdapter.Submit();
 }
 catch (Exception ex)
 {
  // The submit failed
  thisXDocument.UI.Alert("Submitting via adapter " + hwsAdapter.Name + "failed." + Environment.NewLine + "Reason: " + ex.Message);
 }
}
else
{
 thisXDocument.UI.Alert("Submit is not allowed on adapter " + hwsAdapter.Name + ".");
}

See Also

Reference

HWSAdapterObject Members
Microsoft.Office.Interop.InfoPath Namespace