MergeDocument Service

The MergeDocument service merges two documents into a single document and places it into the primary document.

The following table provides an overview of the MergeDocument service:

Category Description
System Name MergeDocument
Graphical Process Modeler (GPM) categories) All Services
Description The MergeDocument service merges two documents into a single document and places it into the primary document.
Business usage A business user would use this service to merge two existing and separate documents into one document.
Usage example A Sterling B2B Integrator business process uses the file system adapter to collect a file. The collected file is first placed into the primary document, and then assigned to a document key to make it available in the document area. The file system adapter collects another file and it, too, is ultimately placed in the document area. The MergeDocument service is then used to combine the two documents from the document area into one, and the resulting merged document is placed into the primary document.
Preconfigured? Yes
Requires third-party files? No
Platform availability All supported Sterling B2B Integrator platforms
Related services None
Application requirements None
Initiates business processes? No
Invocation This service is initiated from a business process.
Business process context considerations Usage of this service requires a document key to be created from the primary document. See the example business process for more details.
Returned status values Returned status values:
  • 0 – Success
  • 1 – Error
Restrictions None
Persistence level Default
Testing considerations None

How the MergeDocument Service Works

Two documents are passed to the MergeDocument service. The service merges the documents into a single document and places the resulting document in the primary document. For example, if document1 (FirstPriDoc) contains the text “This is test document 1,” and document2 (SecondPriDoc) contains the text “This is test document 2,” then the new primary document (after the merge) will contain the text “This is test document 1This is test document 2.”

The MergeDocument service is preconfigured, so there is no implementation or configuration necessary.

Parameters Passed From the Business Process to the Service

The following table contains the parameters passed from the business process to the MergeDocument service:

Field Description
document1 Specify the path and file name of a document that you want to merge with another document.
document2 Specify the path and file name of the document that you want to merge with the document specified in document1.

Business Process Example

The following example illustrates how the MergeDocument service can be used in a business process:

<process name="MergeDocumentProcess">
  <sequence>
   <operation name="File System Adapter">
     <participant name="FileSystemAdapterInstance"/>
     <output message="FileSystemInputMessage">
       <assign to="." from="*"></assign>
       <assign to="Action">FS_COLLECT</assign>
       <assign to="deleteAfterCollect">false</assign>
       <assign to="filter">file1.txt</assign>
     </output>
      <input message="inmsg">
       <assign to="." from="*"></assign>
     </input>
    </operation>
   <assign to="doc1" from="PrimaryDocument/@SCIObjectID"></assign>
   <operation name="File System Adapter">
     <participant name="FileSystemAdapterInstance"/>
     <output message="FileSystemInputMessage">
       <assign to="." from="*"></assign>
       <assign to="Action">FS_COLLECT</assign>
       <assign to="deleteAfterCollect">false</assign>
       <assign to="filter">file2.txt</assign>
     </output>
      <input message="inmsg">
       <assign to="." from="*"></assign>
     </input>
    </operation>
   <assign to="doc2" from="PrimaryDocument/@SCIObjectID"></assign>
   <operation name="MergeDocument">
   <participant name="MergeDocumentInstance"/>
     <output message="MergeDocumentInputMessage">
       <assign to="." from="*"></assign>
       <assign to="document1" from="'doc1'"></assign>
       <assign to="document2" from="'doc2'"></assign>
     </output>
      <input message="inmsg">
       <assign to="." from="*"></assign>
     </input>
    </operation>
 </sequence> 
</process>

Parameters Passed From Service to Business Process

The following table contains the parameters passed from the MergeDocument service to the business process:

Parameter Description
PrimaryDocument The link to the primary document. Optional.