# One-Step Scenario: SelectAndGenerate

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

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <c:SelectAndGenerateRequest 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:DocumentFormat>PDF</c:DocumentFormat>
    <c:Watermark>
    <c:Text>ORIGINAL</c:Text>
    </c:Watermark>
    </c:SelectAndGenerateRequest>
    </soap:Body>
    </soap:Envelope>

The response from SelectAndGenerate contains the assembled and watermarked documents.

    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <r:SelectAndGenerateResponse xmlns:r="http://schemas.bankerssystems.com/2004/ExpereAPI/ExpereIEServices">
    <r:DocSet>
    <r:DocSetTxnIDRef/>
    <r:DocSetPackageIDRef>PKG.SamplePackage</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>true</r:DocAutoselected>
    <r:DocSuggested>true</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:SelectAndGenerateResponse>
    </soap:Body>
    </soap:Envelope>