Human Interaction Document Loader Service

The Human Interaction Document Loader service retrieves a document that is previously saved in the Sterling B2B Integrator database by the Human Interaction Event service.

After the document is retrieved, the Human Interaction Document Loader service loads the document into the business process as the primary document. The following table provides an overview of the Human Interaction Document Loader service:

System name HumanInteractionDocumentLoader
Graphical Process Modeler (GPM) categories All Services, Web Extensions
Description Uses a valid MinedDataId of a previously saved document to retrieve the document from the Sterling B2B Integrator database.
Note: The MinedDataId is created when a document is added to the database using the Human Interaction Event service, and corresponds to the value in the MINED_DATA_ID column of the WEBX_MINED_DATA table.
Business usage A business process uses the Human Interaction Event service to save a document requiring approval in the database and then sends out an e-mail notification to the approver. The e-mail notification includes the URL with the Web template, along with the MinedDataId, for retrieving and displaying the document. The Web template includes a call to a business process that uses the Human Interaction Document Loader service to retrieve the document and the B2B HTTP Server adapter for displaying the document in the Web browser for approval or rejection.
Note: Because of our continuing efforts to improve services and adapters to align with new technology and capabilities, the B2B HTTP Server adapter has entered the retirement process in Sterling B2B Integrator and will be replaced with the HTTP Server adapter. See Retiring and Removed Services and Adapters.
Usage example The individual responsible for approving a purchase order does the following: Receives an e-mail notification with a URL link for displaying the purchase order. Launches a Web browser and specifies the URL link. Approves or rejects the purchase order displayed in the Web browser.
Preconfigured? No
Requires third-party files? No
Platform availability All supported Sterling B2B Integrator platforms
Related services Designed to work with:
  • Human Interaction Query service
  • B2B Lookup System service
  • B2B HTTP Server adapter
  • HTTP Server adapter
  • Human Interaction XForms service
Note: Because of our continuing efforts to improve services and adapters to align with new technology and capabilities, the B2B HTTP Server adapter has entered the retirement process in Sterling B2B Integrator and will be replaced with the HTTP Server adapter. See Retiring and Removed Services and Adapters.
Application requirements None
Initiates business processes? None
Invocation Runs as part of a business process.
Business process context considerations None
Returned status values Returned status values:
  • WorkFlowContext.SUCCESS: Success, with no errors.
  • WorkFlowContext.ERROR NoMinedDataIDException: Caught NoMinedDataIDException in DocumentLoaderService.processData()
Restrictions None
Persistence level None
Testing considerations None

How the Human Interaction Document Loader Service Works

Use the Human Interaction Document Loader service to retrieve documents from the Sterling B2B Integrator database. The following sections describe a business scenario and a sample solution using the Human Interaction Document Loader service.

Business Scenario

Your company receives purchase orders in XML format from a trading partner. All purchase orders exceeding $1,000.00 need to be approved. You want to view a purchase order requiring approval in the Web browser.

Business Solution Example

The approach used to solve this business scenario includes creating a business process that includes:
  • A Human Interaction Document Loader service to retrieve the purchase order requiring approval
  • A B2B HTTP Server adapter or HTTP Server adapter to display the purchase order in the Web browser.
    CAUTION:
    Because of our continuing efforts to improve services and adapters to align with new technology and capabilities, the B2B HTTP Server adapter has entered the retirement process in Sterling B2B Integrator and will be replaced with the HTTP Server adapter. See Retiring and Removed Services and Adapters.

Business Solution Example Dependencies

The following dependencies must be met to run the example in this section and display the purchase order in a Web browser:
  • Run a business process that accepts a purchase order as input and uses the Human Interaction Event service to store the purchase order in the Sterling B2B Integrator database and mark it as requiring approval. The Human Interaction Event service must also be configured to invoke a business process that constructs and sends an e-mail notification containing the URL for displaying the purchase order to the approver. The URL must contain the name of the Web template, along with the document ID for the purchase order requiring approval. See the business scenario and business solution example for the B2B Lookup System service for an example business process.
  • Deploy a Web template in Sterling B2B Integrator that invokes the business process in this example and displays the purchase order in the Web browser.
  • Create a configuration of the HTTP Respond service that specifies the URI used to invoke the business process created in this example from the Web browser.

This business solution example focuses only on the Human Interaction Document Loader service functionality.

GPM Example

The following example shows a solution to the business scenario using the GPM.

Note: This example assumes that the Web template used to display the purchase order is deployed in Sterling B2B Integrator.

The Human Interaction Event service (not shown) generated an e-mail notification to the approver after the purchase order was added to the database. The approver uses this URL to display the purchase order requiring approval in the Web browser. For example:

http://siHostName:siport/websuite/xfm/ExamplePurchaseOrderFromHTTPRequest.xfm?documentId=7736bd:fb78c70638:-77df 
Where:
  • ExamplePurchaseOrderFromHTTPRequest.xfm is the name of the Web template used to display the purchase order. This Web template is designed to invoke the business process that retrieves the purchase order from the Sterling B2B Integrator database.
  • documentId is set to the MinedDataId (7736bd:fb78c70638:-77df) of the requested document in the Sterling B2B Integrator database.

The business process run by the Web template uses the Human Interaction Document Loader service to retrieve from the database the purchase order that corresponds to the documentId, and uses the B2B HTTP Server adapter to display the purchase order in the Web browser.

CAUTION:
Because of our continuing efforts to improve services and adapters to align with new technology and capabilities, the B2B HTTP Server adapter has entered the retirement process in Sterling B2B Integrator and will be replaced with the HTTP Server adapter. See Retiring and Removed Services and Adapters.

After the Human Interaction Document Loader service completes, the purchase order is returned to the business process as the primary document, along with a document named HumanInteractionEvents, which contains the reference data from the Human Interaction Event service for the purchase order. The returned Human Interaction Events document for this example looks like the following:

The returned primary document (purchase order) for this example looks like the following:

<Order Id="200"> 
	<Order_Item Id="400"> 
 	<Order_Id>200</Order_Id> 
 	<Name>DSL</Name> 
 	<Quantity>1</Quantity> 
 	<Price> $1050.00</Price> 
	</Order_Item> 
	<Order_Item Id="401"> 
 	<Order_Id>200</Order_Id> 
 	<Name>Cable</Name> 
 	<Quantity>1</Quantity> 
 	<Price> $1500.00</Price> 
	</Order_Item> 
</Order>

The primary document is then sent to the B2B HTTP Server adapter for display in the Web browser.

CAUTION:
Because of our continuing efforts to improve services and adapters to align with new technology and capabilities, the B2B HTTP Server adapter has entered the retirement process in Sterling B2B Integrator and will be replaced with the HTTP Server adapter. See Retiring and Removed Services and Adapters. For example, you might have a Web template that displays the purchase order in the following HTML format:

The approver can choose to approve or reject the purchase order.

Business Process Modeling Language (BPML) Example

The following example shows the corresponding business process solution using BPML.

<process name="ExamplePurchaseOrderHIDocLoader"> 
<sequence name="Start"> 
<operation name="Human Interaction Document Loader"> 
<participant name="HumanInteractionDocumentLoader"/> 
<output message="HumanInteractionDocumentLoaderTypeInputMessage"> 
	<assign to="MinedDataId" from="documentId/text()"/> 
	<assign to="." from="*"/> 
	</output> 
<input message="inmsg"> 
	<assign to="." from="*"/> 
</input> 
</operation> 
<operation name="HTTP Respond Service">
      <participant name="HttpRespond"/>
      <output message="HttpRespondServiceInputMessage">
        <assign to="." from="*"></assign>
      </output>
      <input message="inmsg">
        <assign to="." from="*"></assign>
      </input>
    </operation> 
</sequence> 
</process> 

Implementing the Human Interaction Document Loader Service

To implement the Human Interaction Document Loader service, complete the following tasks:
  1. Activate your license for the Human Interaction Document Loader service. See Installing Sterling B2B Integrator.
  2. Create a Human Interaction Document Loader service configuration. See Managing Services and Adapters.
  3. Use the Human Interaction Document Loader service in a business process. For information, see Human Interaction Document Loader Service Business Process Usage.

Human Interaction Document Loader Service Business Process Usage

The following screen shows a graphical view of the GPM parameters for the Human Interaction Document Loader service. There are no fields to be configured on the Message From Service tab.

The following example shows the corresponding BPML parameters for the Human Interaction Document Loader service GPM parameters.

<process name="ExamplePurchaseOrderHIDocLoader"> 
<sequence name="Start"> 
<operation name="Human Interaction Document Loader"> 
<participant name="HumanInteractionDocumentLoader"/> 
<output message="HumanInteractionDocumentLoaderTypeInputMessage"> 
	<assign to="Downloadable">YES</assign> 
	<assign to="MinedDataId" from="documentId/text()"/> 
	<assign to="." from="*"/> 
</output> 
<input message="inmsg"> 
	<assign to="." from="*"/> 
</input> 
</operation> 
</sequence> 
</process> 

The following table describes the fields used to configure the Human Interaction Document Loader service in the GPM. The values specified for these parameters are the input to the Human Interaction Document Loader service from the business process.

Field Description
Config Name of the service configuration.
Downloadable Whether a file download box displays when trying to download files. This parameter applies to Web Extension applications that provide a means to download, save, or display the content of a file saved in a workflow. Valid values:
  • Yes – Always displays the file download box each time you download a file to your client computer, regardless of file type. This gives you the option of saving the file to disk or displaying the file contents in the browser regardless of the file type.
  • No – Determines whether or not to display a file download box based on the file content. For example, if the downloaded file is in XML format, the browser displays the raw XML in the browser rather than prompting you to save the file. If the downloaded file is text format, the browser prompts you to either display or save the file to disk.
MinedDataId Unique identifier that is associated with a document within a business process and corresponds to the value in the MINED_DATA_ID column of the WEBX_MINED_DATA table in the Sterling B2B Integrator database. This value is populated when a document is added to the database using the Human Interaction Event service. Valid value is a MinedDataId that exists in the WEBX_MINED_DATA table.
Note: If you want to reuse the business process and service, you should not hardcode this value. Instead, use an XPath expression to set this parameter.

Output from Service to Business Process

The following table describes the output from the Human Interaction Document Loader service to the business process:

Returned Output Description
HumanInteractionEv ents/@SCIObjectID document The name of the document, along with the document SCI Object ID, returned by the Human Interaction Document Loader service. This document contains the reference data from the Human Interaction Event service for the specific document retrieved from the Sterling B2B Integrator database.