# Two-Step Scenario: Select and Generate methods

This scenario demonstrates the use of the Select method to perform autoselection, followed by the Generate method to perform document assembly and watermarking.
Note: It is assumed that data needed to produce the document has been gathered prior to executing the scenario.
The Select operation is invoked, providing the transaction data, organization ID, and life cycle phase. ListLinesOfBusiness and ListPhases may be used to gather phase information.

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <c:SelectRequest xmlns:c="http://schemas.bankerssystems.com/2004/ExpereAPI/ExpereIEServices">
    <c:Transaction>
    <c:Data>
    <!-- Transaction data goes here. -->
    </c:Data>
    </c:Transaction>
    <c:Organization>
    <!-- The Organization ID for the transaction goes here. -->
    <c:OrganizationID>00000000000000000000000000000000</c:OrganizationID>
    </c:Organization>
    <c:LOBPhase>
    <c:LineOfBusinessID>PHASES.SampleLineOfBusiness</c:LineOfBusinessID>
    <c:Phase>Sample Phase</c:Phase>
    </c:LOBPhase>
    </c:SelectRequest>
    </soap:Body>
    </soap:Envelope>

The response from Select includes the transaction ID and the autoselection results. The transaction ID will be used in subsequent requests to reference this transaction. The autoselection results will be used by the caller to determine which documents to assemble in the next step.

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <r:SelectResponse xmlns:r="http://schemas.bankerssystems.com/2004/ExpereAPI/ExpereIEServices">
    <r:Transaction>
    <!-- The TransactionID is the unique key for this transaction in the system. -->
    <r:TransactionID>d9739b99c3cb11d99f2adcbb0861aa63</r:TransactionID>
    </r:Transaction>
    <r:DocumentSet>
    <r:Document>
    <r:DocumentID>PKGD.SampleDocument1</r:DocumentID>
    <r:DisplayName>Sample Document 1</r:DisplayName>
    <r:Type>Template</r:Type>
    <r:Autoselected>true</r:Autoselected>
    <r:Prepare>true</r:Prepare>
    <r:Suggested>true</r:Suggested>
    </r:Document>
    </r:DocumentSet>
    </r:SelectResponse>
    </soap:Body>
    </soap:Envelope>

The Generate operation is invoked, providing the transaction ID from the SelectResponse message, the set of documents to assemble, and the watermark information.

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <c:GenerateRequest xmlns:c="http://schemas.bankerssystems.com/2004/ExpereAPI/ExpereIEServices">
    <c:Transaction>
    <!-- TransactionID returned from CreateTransaction goes here. -->
    <c:TransactionID>d9739b99c3cb11d99f2adcbb0861aa63</c:TransactionID>
    </c:Transaction>
    <c:DocumentSet>
    <c:Document>
    <c:DocumentID>PKGD.SampleDocument1</c:DocumentID>
    </c:Document>
    </c:DocumentSet>
    <c:DocumentFormat>PDF</c:DocumentFormat>
    <c:Watermark>
    <c:Text>ORIGINAL</c:Text>
    </c:Watermark>
    </c:GenerateRequest>
    </soap:Body>
    </soap:Envelope>

The response from Generate contains the assembled and watermarked documents.

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <r:GenerateResponse xmlns:r="http://schemas.bankerssystems.com/2004/ExpereAPI/ExpereIEServices">
    <r:DocSet>
    <r:DocSetTxnIDRef>d9739b99c3cb11d99f2adcbb0861aa63</r:DocSetTxnIDRef>
    <r:DocSetPackageIDRef/>
    <r:PackageDocs>
    <r:PackageDoc PackageDocID="PKGD.SampleDocument1">
    <r:DocDescriptor>
    <r:DocID>PKGD.SampleDocument1</r:DocID>
    <r:DocType>Template</r:DocType>
    <r:DocDisplayName>Sample Document 1</r:DocDisplayName>
    <r:DocRootEntityName>DOC.SampleDocument1</r:DocRootEntityName>
    <r:DocCustomDataItems>
    <r:DocCustomDataItem DataItemName=”InterimIndicator”>Y
    </r:DocCustomDataItem>
    <r:DocCustomDataItem DataItemName=”DocType”>12345
    </r:DocCustomDataItem>
    <r:DocCustomDataItem DataItemName=”FormNumber”>HCFG-00004
    </r:DocCustomDataItem>
    <r:DocCustomDataItem DataItemName=”FormVersion”>v11.06
    </r:DocCustomDataItem>
    </r:DocCustomDataItems>
    </r:DocDescriptor>
    <r:DocWorkOrder>
    <r:DocPrepare>true</r:DocPrepare>
    <r:DocAutoselected>false</r:DocAutoselected>
    <r:DocSuggested>false</r:DocSuggested>
    <r:DocFormat>PDF</r:DocFormat>
    <r:DocStyle>ExpereStandard</r:DocStyle>
    </r:DocWorkOrder>
    </r:PackageDoc>
    </r:PackageDocs>
    <r:Packet PacketName="Default" PacketType="Default">
    <r:DocInstance DocIDRef="PKGD.SampleDocument1">
    <r:DocData>
    <r:base64>
    <!-- Base64 encoded PDF data will be here. -->
    </r:base64>
    </r:DocData>
    <r:InstanceDisplayName>Sample Document 1</r:InstanceDisplayName>
    <r:InstanceFileName>Suggested file name for document 1</r:InstanceFileName>
    <r:InstancePacketType>Default</r:InstancePacketType>
    <r:InstancePacketName>Default</r:InstancePacketName>
    <r:InstanceSequence>999</r:InstanceSequence>
    <r:InstancePageCount>1</r:InstancePageCount>
    </r:DocInstance>
    </r:Packet>
    </r:DocSet>
    <r:DocSetSummary>
    <r:PacketCount>1</r:PacketCount>
    <r:DocInstanceCount>1</r:DocInstanceCount>
    <r:PageCount>1</r:PageCount>
    </r:DocSetSummary>
    </r:GenerateResponse>
    </soap:Body>
    </soap:Envelope>