Printing a packing slip with the GetPackListData service

The data required to print a packlist is obtained by invoking the GetPackListData service.

About this task

The XML shown in XML Generated After XSL Translation prints a Packing Slip (PACKLIST) as specified by the BeforeChildrenPrintDocumentId attribute in the PrintDocument node.

The data required to print the packlist is obtained by invoking the GetPackListData service as specified by the FlowName attribute in the InputData node.

To configure the GetPackListData service definition:

Procedure

  1. From the Application Platform tree, choose Process Modeling > Container > Pack Process. The Pack Process window is displayed.
  2. Choose Service Definitions Tab. From Pack Process Repository > Prints, choose GetPackListData.
  3. The Service Details: GetPackListData (Pack Process) window is displayed, showing the service process model and the service properties.

Results

The GetPackListData service calls the GetShipmentDetails() API and the output is transformed using the XSL Translator.

The XSL translator (as reproduced below) calculates the backordered quantity for the shipment lines returned by the GetShipmentDetails() API:

   <?xml version = "1.0" encoding = "UTF-8"?>
   <xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = 
     "1.0">
      <xsl:output indent="yes"/>
      <xsl:template match="/Shipment">
         <Shipment>
            <xsl:choose>
               <xsl:when test="not(@ActualShipmentDate) or 
     (@ActualShipmentDate=&quot;&quot;)">
                  <xsl:attribute name="ActualShipmentDate"><xsl:value-of 
     select="@ExpectedShipmentDate"/></xsl:attribute>
               </xsl:when>
               <xsl:otherwise>
                  <xsl:attribute name="ActualShipmentDate"><xsl:value-of 
     select="@ActualShipmentDate"/></xsl:attribute>
               </xsl:otherwise>
            </xsl:choose>
            <xsl:message>ActualShipmentDate<xsl:value-of 
     select="@ActualShipmentDate"/></xsl:message>
            <xsl:for-each select="@*">
               <xsl:if test="not(name()= &quot;ActualShipmentDate&quot;)">
                   <xsl:attribute name="{name()}"><xsl:value-of select="."/>
                   </xsl:attribute>
               </xsl:if>
            </xsl:for-each>
            <xsl:copy-of select="SellerOrganization"/>
            <xsl:copy-of select="Carrier"/>
            <xsl:copy-of select="ShipNode"/>
            <xsl:copy-of select="ToAddress"/>
            <xsl:copy-of select="MarkForAddress"/>
            <xsl:copy-of select="BillingInformation"/>
            <xsl:copy-of select="Instructions"/>
            <xsl:copy-of select="Containers"/>
            <ShipmentLines>
               <xsl:for-each select="ShipmentLines/ShipmentLine[@Shipment
               SubLineNo='0']">
                  <ShipmentLine>
                     <xsl:variable name="qty" 
     select="sum(OrderLine/OrderStatuses/OrderStatus[@OrderLineKey=current()
     /@OrderLineKey and substring(@Status,1,4)='1300']/@StatusQty)"/> 
                     <xsl:attribute name="OrderedQty">
                        <xsl:value-of 
     select="sum(OrderLine/OrderStatuses/OrderStatus[@OrderLineKey=current()/
     @OrderLineKey and not(substring(@Status,1,4)='1400')]/@StatusQty)"/> 
                     </xsl:attribute>
                     <xsl:attribute name="BackOrderedQty">
                           <xsl:value-of select="$qty"/>
                        </xsl:attribute>
                     <xsl:copy-of select="@*"/>
                     <xsl:copy-of select="OrderLine"/>
                  </ShipmentLine>
               </xsl:for-each>
            </ShipmentLines>
         </Shipment>
      </xsl:template>
   </xsl:stylesheet>

Once a service has been created for a print, it should be associated to an appropriate event.