MarcomProcessOrders

This workflow and the MarcomProcessJobTicket workflow demonstrate how to exchange data with the MarcomCentral web site using SOAP web services. The demonstration includes a SOAP web service input device and a SOAP web service notification.

The MarcomReceiveOrders SOAP web service input device simulates a call to a MarcomCentral web service. The input device retrieves an XML order from the sample store at the MarcomCentral web site and sends the XML job to the MarcomProcessOrders workflow.

The SetJobPropsFromTextFile step sets the Job name property to Marcom Sample Order.

The DetectInputDataStream step sets the data stream to XML.

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

The CallSOAPService step simulates a call to a MarcomCentral web service, and it retrieves 2 job tickets for the XML order. The value in the password field tells Ricoh ProcessDirector to run the simulation instead of calling the web service.

The ApplyXSLTransform2 step uses the jobTicketsReceived.xslt XSLT style sheet to compute the value of the Custom 3 property by counting the number of job tickets that have been retrieved. 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.

The CheckTicketCount step calls 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.

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.

      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.

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

The original order job is sent to the WaitForRelatedJobs step.

When all the child jobs for the order arrive at the WaitForRelatedJobs step in the MarcomProcessJobTicket workflow, Ricoh ProcessDirector sends the order job to the RetainCompletedJobs step. The state of the order job changes to Retained.

When that event occurs, the MarcomCloseoutOrder web service notification simulates a call to a MarcomCentral web service. The web service changes the status of the XML order at the sample store.

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

Phases and steps

The 2 illustrations show the steps in the sample workflow. Follow the numbers at the end of the first illustration onto the path with the same number in the next illustration.

Receive and Prepare (3 steps)Image

Prepare (4 steps), Print, and CompleteImage

 
Copyright © 2016, 2018