Order Processing End-to-End Demonstration

This sample demonstrates using Video Clips the complete creation of a basic order processing scenario in SmartsIntegrator.  Specifically here’s the scenario:

  • Xml orders are received from a customer
  • A copy of each order must be sent to the legacy accounts system in CSV format.
  • For each item in the order, the current stock level must be checked by calling a web service.
  • Any items out of stock will need to be ordered from the supplier, by sending an Xml order to the supplier. This order format is different to the customer order format.

This scenario has been broken down into a number of stages, each with an animated video clip. A Pause button is provided with the video player, so the stages can be paced to requirerment.

(1) Create the CustomerOrder schema  Here we define the schema to be used for receiving Customer Orders, as defined by the following sample Message:

<CustomerOrder xmlns:xsi=”” CustomerId=”Customer1”CustomerEmail=”” CustomerName=”Customer1” OrderDate=”2008-04-01T13:01:01.0000000+00:00”>

(2) Create the SupplierOrder Schema  Here we define the schema to be used for sending Supplier Orders, as defined by the following sample Message:

    <OrderItem ItemCode="ItemCode1" Quantity="1">OrderItem1</OrderItem>
    <OrderItem ItemCode="ItemCode2" Quantity="24">OrderItem2</OrderItem>
    <OrderItem ItemCode="ItemCode3" Quantity="11">OrderItem3</OrderItem>
    <OrderItem ItemCode="ItemCode4" Quantity="10">OrderItem4</OrderItem>
    <OrderItem ItemCode="ItemCode5" Quantity="2">OrderItem5</OrderItem>

(3) Create the AccountsOrder Schema  Here we define the CSV file Schema, as defined by the following sample Message:


(4) Create the CustomerOrder to SupplierOrder Map  Here we create a Map to convert from a customer order to a supplier order, translating the product codes. This Map copies over all order quantities literally, though shortly we will write a workflow to subsequently adjust the quantities being ordered according to current stock levels.

(5) Create the CustomerOrder to AccountsOrder Map  Here we create a map to convert from a customer order to the format to be sent to the accounts system.

(6) Create the Order Workflow  Here we create a Workflow to receive the customer order, map it to a supplier order and an account order, iterate the items in the order checking current stock levels and fixing up the supplier order, and then send the supplier and accounts orders.

(7) Test the Order Workflow  Here we run a simple test file through the workflow to test for expected results. We can use the sample XML from stage 1.

(8) Create the Ports, and Bind the Workflow  Here we create a Receive Port to receive the incoming customer order, and we create two Send Ports for the supplier and accounts orders.  Then we bind the Order Workflow to the Ports we created, so it is ready to run.

If you’ve been following along, if you now drop a sample Customer Order file into the receive directory, you should get Supplier and Accounts orders output into the corresponding send directories within a few seconds. If things do not run as expected, check the Server is running, all ports are enabled, and that there are no errors in the Tracking log.