Running the sample workflows for processing orders retrieved from MarcomCentral

The MarcomProcessOrders and MarcomProcessJobTicket workflows show how to process orders retrieved from a sample store at the MarcomCentral web site. The sample store serves as a test environment for the RICOH ProcessDirector web services interface to MarcomCentral. A SOAP web service input device, 2 CallSOAPService steps, and a SOAP web service notification communicate with the MarcomCentral web site. The workflows also give examples of these steps: ApplyXSLTransform, CreateJobsFromXML, and DownloadFile.

The sample input device, CallSOAPService steps, and notification run a simulation. They do not call the specified MarcomCentral web services. The simulation lets you run the samples without getting your own MarcomCentral credentials and setting up a sample MarcomCentral store that resembles the sample store. The samples use SOAP 1.1 request payloads to retrieve a simulated MarcomCentral order and 2 job tickets. The value in the static credential and password fields tells RICOH ProcessDirector to run the simulation.

After you run the samples, you can copy them. Then you can adjust the values in the copies to exchange data with your own store at the MarcomCentral web site.

    Note:
  • The sample objects and files are installed with the MarcomCentral Connect feature.

The simulation includes Web Services Description Language (WSDL) SOAP request objects imported from MarcomCentral. The sample input device, CallSOAPService steps, and notification each specify a SOAP request.

This simulation uses these objects and files:

  • Workflows:
    • MarcomProcessOrders
    • MarcomProcessJobTicket
  • Input device: MarcomReceiveOrders

    The input device retrieves XML orders from the MarcomCentral web site by simulating a call to a web service at https://services.printable.com/Trans/1.0/Order.asmx

    The SOAP request is Marcom-GetOrdersByDate.

  • Notification: MarcomCloseoutOrder

    The notification sends order completion information to the MarcomCentral web site by simulating a call to a web service at https://services.printable.com/Trans/1.0/Closeout.asmx

    The SOAP request is MarcomSample-CloseoutByOrder.

  • XML orders

    In the simulation, one order is retrieved every 30 seconds from the web service.

    After you run the sample workflows, you can see the contents of a sample order. Go to: /aiw/aiw1/spool/default/job_number

    Replace job_number with the number of the job, for example, 10000001.

    Display the contents of the job_number.print.xml file, for example, 10000001.print.xml.

  • XML job tickets

    In the simulation, 2 job tickets are retrieved for every order.

    After you run the sample workflows, you can see the contents of the 2 sample job tickets. Go to: /aiw/aiw1/spool/default/child_job_number

    Replace child_job_number with the number of the child job, for example, 10000001.1 or 10000001.2.

    Display the contents of the child_job_number.print.xml file, for example, 10000001.1.print.xml or 10000001.2.print.xml.

  • Print file: Savings.pdf

    This file is downloaded locally from http://localhost:15080/restapi/

  • XSLT style sheet files:
    • orderToOverrides.xslt
    • jobticketsReceived.xslt
    • jobticketToOverrides.xslt
    • skuToOverrides.xslt
    • downloadOverrides.xslt

    The files are in the Marcom directory: /aiw/aiw1/testfiles/Marcom

  • Stock-keeping unit (SKU) files:
    • SKU13933967.xml
    • SKU15302443.xml

    The files are in the Marcom directory: /aiw/aiw1/testfiles/Marcom

  • CallSOAPService steps:
    • The first CallSOAPService step retrieves XML job tickets from the MarcomCentral web site by simulating a call to a web service at https://services.printable.com/Trans/1.0/JobTicket.asmx

      The SOAP request is Marcom-GetJobTicketsByOrderNumber.

    • The second CallSOAPService step retrieves a job ticket from the MarcomCentral web site by simulating a call to a web service at https://services.printable.com/Trans/1.0/JobTicket.asmx

      The SOAP request is Marcom-GetJobTicketByLineItem.

  • The CheckTicketCount step, which is based on the CallRESTService step template, calls a web service at http://localhost:15080/restapi/1.0/util/compareProperties

To run the sample workflow:

  1. Click the Main tab.
  2. In the Printers portlet, right-click the Sample printer and select Enable.
  3. In the Input Devices portlet, right-click the MarcomReceiveOrders SOAP web service input device and select Enable and Connect.

    A job named Marcom Sample Order appears in the jobs table.

  4. Right-click the MarcomReceiveOrders input device and select Disable.
  5. Right-click the input device again and select Disconnect.
      Note:
    • The sample input device polls for orders every 30 seconds and retrieves an XML job. If you do not disable and disconnect the input device, a new job appears in the jobs table every 30 seconds.

    The request payload for the input device includes these RICOH ProcessDirector symbols:

    <PartnerCredentials> <Token>${WebService.StaticCredential}</Token></PartnerCredentials><DateRange> <Start>${WebService.LastSuccessRequestTime}</Start> <End>${WebService.CurrentRequestTime}</End></DateRange>

    The ${WebService.StaticCredential} symbol specifies the static credential. The ${WebService.LastSuccessRequestTime} symbol specifies the date and time when the input device last successfully requested a response from the web service. The ${WebService.CurrentRequestTime} symbol specifies the date and time of the current request.

    Each time the MarcomReceiveOrders input device retrieves an XML job, it sends the job to the MarcomProcessOrders workflow.

    The job goes through these and other steps in the MarcomProcessOrders workflow:

    • The SetJobPropsFromTextFile step sets the Job name property to Marcom Sample Order.
    • The ApplyXSLTransform step uses the orderToOverrides.xslt XSLT style sheet to convert 8 XML elements into 5 RICOH ProcessDirector job properties in an overrides file.

      The table lists the job properties in the order that they are specified in the XSLT style sheet and appear in the overrides file.

      XML element Database name of job property User interface name of job property
      OrderNumber Job.Marcom.OrderNumber MarcomCentral order number
      ID Job.Marcom.OrderId MarcomCentral order ID
      ShippingAddress/Address1ShippingAddress/CityShippingAddress/StateShippingAddress/Zip Job.Info.Attr1 Custom 1
      User/Email Job.CustomerName Customer name
      count(OrderDetails/OrderDetail) Job.Info.Attr2 Custom 2

      This example shows the contents of the sample overrides file:

      Job.Marcom.OrderNumber=WS113Job.Marcom.OrderId=8487184Job.Info.Attr1=400 Main Street Anywhere CO 11111Job.CustomerName=Myrna.Jensen@company.comJob.Info.Attr2=2

      The step puts the overrides file in the spool directory for the job. RICOH ProcessDirector uses the values in the overrides file to set the values of the properties for the job.

    • The CallSOAPService step calls the MarcomCentral web service that returns job tickets for a specified order. The step specifies 2 RICOH ProcessDirector symbols as part of the value in the Request payload property:

      <Token>${Job.WebService.Password}</Token><PONumber>${Job.Marcom.OrderId}</PONumber>

      The ${Job.WebService.Password} symbol specifies the static credential. The ${Job.Marcom.OrderId} symbol specifies the order ID.

    • The ApplyXSLTransform2 step uses the jobTicketsReceived.xslt XSLT style sheet to compute the value of the Job.Info.Attr3 property by counting the number of job tickets that have been retrieved.
      XML element Database name of job property User interface name of job property
      count(ns0:Envelope/ns0:Body/ns2:GetJobTicketsByOrderNumberResponse/ns1:GetJobTicketResponse/JobTicket) Job.Info.Attr3 Custom 3

      The step puts the value in an overrides file, and overwrites the overrides file in the spool directory for the job with the new overrides file.

      This example shows the contents of the overrides file after all job tickets have been retrieved:

      Job.Info.Attr3=2

    • The CheckTicketCount step makes a POST call to a RICOH ProcessDirector web service. The web service checks whether all the job tickets for an order have been retrieved. The step compares the values of Custom 2 (total job tickets) and Custom 3 (retrieved job tickets). If the values match, the step sets the value of Custom 4 (result of comparison) to EQUAL.

      The step puts the value in an overrides file, and overwrites the overrides file in the spool directory with the new overrides file.

      This example shows the contents of the overrides file after all job tickets have been retrieved:

      Job.Info.Attr4=EQUAL

    • The rule on the [1] All tickets found connector checks whether the value of the Custom 4 job property (result of comparison) is EQUAL.
      • If it is, the number of job tickets retrieved equals the total number of job tickets expected. The workflow sends the job directly to the CreateJobsFromXML step.
      • If it is not, the number of job tickets retrieved is less than the total number of job tickets expected. The rule on the [2] Check for tickets connector checks whether the value of the Custom count 1 job property is less than 10. The first time that the job arrives at the CheckTicketCount step, the value of the Custom count 1 property is 0.
        • If the value is 0 through 9, the workflow sends the job to the Wait step, which waits for 1 minute. The workflow then sends the job to the RunExternalProgram step.

          The RunExternalProgram step runs a Java utility that increments the value of the Custom count 1 property by 1. The workflow then sends the job back to the CallSOAPService step. The step repeats the call to the MarcomCentral web service that returns job tickets for the order. If the number of job tickets retrieved is less than expected, the workflow can send the job through the CallSOAPService step up to 9 times.

        • If the value is 10, the job has been sent to the CallSOAPService step 10 times. After 10 minutes, the number of job tickets retrieved does not equal the number expected. The job does not meet the rule on the [2] Check for tickets connector. The workflow sends the job through the [3] Timeout connector to the FailWithMesssage step and writes a failure message to the job log. The message states: Some job tickets were not found in the time allowed.

            Note:
          • Because the message is a job property, it appears on the Information tab of the job property notebook for all jobs that go through the workflow. The message appears in the job log only when the workflow sends the job through the [3] Timeout connector to the FailWithMesssage step.

    • The CreateJobsFromXML step uses the //JobTicket XPath expression to parse the XML job ticket information. The step finds 2 job tickets and creates 2 child jobs.

      Child jobs named Jensen Bank Baseball Cap and Brochure appear in the jobs table.

      The step submits the 2 child jobs to the MarcomProcessJobTicket workflow.

      The original order job is sent to the WaitForRelatedJobs step.

    The child jobs go through these and other steps in the MarcomProcessJobTicket workflow:

    • The ApplyXSLTransform step uses the jobticketToOverrides.xslt XSLT style sheet to convert 10 XML elements into 10 RICOH ProcessDirector job properties in an overrides file.

      The table lists the job properties in the order that they are specified in the XSLT style sheet and appear in the overrides file.

      XML element Database name of job property User interface name of job property
      OrderDetails/OrderDetail/OrderID Job.Marcom.OrderId MarcomCentral order ID
      OrderDetails/OrderDetail/SKUDescription Job.Info.Attr1 Custom 1
      OrderDetails/OrderDetail/SKU/ID Job.Info.Attr4 Custom 4
      OrderDetails/OrderDetail/ProductType Job.Marcom.ProductType MarcomCentral product type
      FinalOutputFileURL/URL Job.Info.Attr3 Custom 3
      floor(OrderDetails/OrderDetail/Quantity) Job.Copies Job copies requested
      floor($var2_current/OrderDetails/OrderDetail/ID) Job.Marcom.JobTicketId MarcomCentral job ticket ID
      OrderDetails/OrderDetail/ProductName Job.Name Job name
      OrderDetails/OrderDetail/ProductDescription Job.Description Job description
      OrderDetails/OrderDetail/Shipping/Method Job.Info.Attr2 Custom 2

      The step puts each overrides file in the spool directory for the corresponding job. Because these jobs are in a new workflow, the overrides files do not overwrite existing overrides files.

      This example shows the contents of the sample overrides file for the Jensen Bank Baseball Cap job:

      Job.Marcom.OrderId=8487184Job.Info.Attr1=RedJob.Info.Attr4=13933967Job.Marcom.ProductType=StaticJob.Info.Attr3=Job.Copies=20Job.Marcom.JobTicketId=22722188Job.Name=Jensen Bank Baseball CapJob.Description=Jensen Bank branded baseball cap features an embroidered patch logo on the front. This fitted cap is made of cotton. Fit may vary depending on the construction, materials and manufacturer.Job.Info.Attr2=Rush Shipping

      This example shows the contents of the sample overrides file for the Brochure job:

      Job.Marcom.OrderId=8487184Job.Info.Attr1=Brochure - Investing_Boulder_6300 Diagonal Highway_Boulder_CO_80301Job.Info.Attr4=15302443Job.Marcom.ProductType=VersionedJob.Info.Attr3=http://localhost:15080/restapi/Savings.pdfJob.Copies=250Job.Marcom.JobTicketId=22722189Job.Name=BrochureJob.Description=Job.Info.Attr2=Rush Shipping

    • The rule on the [1] No SKU Details connector checks whether the job has a stock-keeping unit (SKU).
        Note:
      • In this sample, an SKU supplies information for producing an item in an order. For example, SKU information for a printable item includes the media to use. SKU information for a non-print item includes the packing material to use. MarcomCentral items can have an SKU number that identifies information stored outside of MarcomCentral. This portion of the workflow accesses that information and converts it into RICOH ProcessDirector job properties.
      • If the value of the Custom 4 (SKU ID) property is not SKU13933967 or SKU15302443, the workflow sends the job directly to the ContinueToNextStep step.
          Note:
        • These 2 SKU IDs match the sample SKU files in the Marcom directory. When you set up RICOH ProcessDirector to communicate with MarcomCentral, you decide how you want to store information about the items in an order.
      • If the value is SKU13933967 or SKU15302443, the workflow sends the job to the ApplyXSLTransform2 step to process the SKU information.

        The ApplyXSLTransform2 step uses the skuToOverrides.xslt XSLT style sheet to convert 3 XML elements into 3 RICOH ProcessDirector job properties.

        The table lists the job properties in the order that they are specified in the XSLT style sheet and appear in the overrides file.

        XML element Database name of job property User interface name of job property
        Media Job.Media Media
        Duplex Job.Duplex Duplex
        Package Job.Info.Attr5 Custom 5

        The step puts the values in an overrides file, and overwrites the overrides file in the spool directory for the job with the new overrides file.

        This example shows the contents of the sample overrides file for the Jensen Bank Baseball Cap job:

        Job.Media=Job.Duplex=NoJob.Info.Attr5=Gift wrap

        This example shows the contents of the sample overrides file for the Brochure job:

        Job.Media=Letter PlainJob.Duplex=YesJob.Info.Attr5=

        The workflow sends the job to the ContinueToNextStep step.

    • When the job arrives at the ContinueToNextStep step, the rule on the [1] Warehouse connector checks the value of MarcomCentral product type property. Versioned, Variable, and JobDirect are product types for printable items.
      • If the item does not have a printable product type, the workflow sends the job through the Warehouse branch.
      • If the item has a printable product type, the workflow sends the job through the Print Shop branch.

    The printable child jobs go through these steps and connectors in the Print Shop branch of the workflow:

    • When the job arrives at the second ContinueToNextStep step, the rule on the [1] File ready connector checks whether the Custom 3 (URL of download file) property is set to a value.
      • If it is, the print file is ready to download. The workflow sends the job directly to the DownloadFile step.
      • If it is not, the rule on the [2] Check for file connector checks whether the value of the Custom count 1 job property is less than 10. The first time that the job arrives at the second ContinueToNextStep step, the value of the Custom count 1 property is 0.
        • If the value is 0 through 9, the workflow sends the job to the Wait step, which waits for 30 seconds. The workflow then sends the job to the CallSOAPService step.

          The CallSOAPService step calls the MarcomCentral web service that retrieves a job ticket for a printable item. The step specifies 2 RICOH ProcessDirector symbols as part of the value in the Web service payload property:

          <Token>${Job.WebService.Password}</Token><LineItemID type=”Printable”>${Job.Marcom.JobTicketId}</LineItemID>

          The ${Job.WebService.Password} symbol specifies the static credential. The ${Job.Marcom.JobTicketId} symbol specifies the job ticket ID.

          The ApplyXSLTransform2 step uses the downloadOverrides.xslt XSLT style sheet to convert an XML element into a RICOH ProcessDirector job property:

          XML element Database name of job property User interface name of job property
          JobTicket/FinalOutputFileURL/URL Job.Info.Attr3 Custom 3

          The step puts the value in an overrides file, and overwrites the overrides file in the spool directory for the job with the new overrides file.

          This example shows the contents of the sample overrides file:

          Job.Info.Attr3=http://localhost:15080/restapi/Savings.pdf

          The RunExternalProgram step runs a Java utility that increments the value of the Custom count 1 property by 1. The workflow then sends the job back to the second ContinueToNextStep step, which sends the job through the Wait step to the CallSOAPService step. The CallSOAPService step repeats the call to the MarcomCentral web service that retrieves a job ticket for a printable item. If the Custom 3 property still does not have a value for the URL, the workflow sends the job through the CallSOAPService step up to 9 times.

        • If the value is 10, the job has been sent to the CallSOAPService step 10 times. After 5 minutes, the Custom 3 property still does not have a value for the file to download. The job does not meet the rule on the [2] Check for file connector. The workflow sends the job through the [3] Timeout connector to the FailWithMesssage step and writes a failure message to the job log. The message states: File was not available to download in the time allowed.

            Note:
          • Because the message is a job property, it appears on the Information tab of the job property notebook for all jobs that go through the workflow. The message appears in the job log only when the workflow sends the job through the [3] Timeout connector to the FailWithMesssage step.

    • The DownloadFile step downloads the Savings.pdf print file from http://localhost:15080/restapi/ by setting the value of the URL for download file property to the ${Job.Info.Attr3} symbol.
    • The OptimizePDF, CountPages, CreatePageRanges, and PrintJobs steps process and print the job on the Sample printer.

    The non-printable child jobs go through this step in the Warehouse branch of the workflow:

    • The ManualStepWithAutoStart step waits for the warehouse staff to indicate that the job is ready to ship.

    The WaitForRelatedJobs step holds the parent job and each of the child jobs until all the child jobs arrive at the step.

  6. In the jobs table, right-click the Jensen Bank Baseball Cap job and select Manual Complete.
  7. Select Move to next step and click OK.

    The job moves to the WaitForRelatedJobs step.

    When both child jobs reach the WaitForRelatedJobs step, the workflow sends the parent and child jobs to the RetainCompletedJobs step. The state of each job changes to Retained.

    The MarcomCloseoutOrder web service notification calls the web service at https://services.printable.com/Trans/1.0/Closeout.asmx

    The request payload includes these RICOH ProcessDirector symbols:

    <PartnerCredentials> <Token>${WSNotification.WebService.Credential}</Token></PartnerCredentials><OrderID> <ID type="Printable">{${Job.Marcom.OrderId}}</Start></OrderID>

    The ${WSNotification.WebService.Credential} symbol specifies the static credential. The ${Job.Marcom.OrderId} symbol specifies the order ID.

    If the notification called the web service instead of running the simulation, this change would occur at the sample store on the MarcomCentral web site. On the Display by Item dialog in the Order Manager, the value in the Order Status column for each item in order number WS113 would change from Work in Progress to Shipped.

  8. In the jobs table, right-click the Brochure job and select View.
    The viewer displays the PDF file that was printed as part of the order.
To run the sample workflows again, enable and connect the MarcomReceiveOrders input device. Then disable and disconnect it.

Now that you have run the samples, you can copy them. Adjust the values in the copies to exchange data with your own store at the MarcomCentral web site. See the related task topics.