FoodBroker project: Fill headers

In the previous sections of this chapter you have seen DML expressions that you can use in the integration engine. Now you can put your knowledge into practice in the FoodBroker project.

The following is a simple exercise to define the basic Mapping Flow with the MB_extractor DML Block and the XML-header-filling section of a Map.

In the project, the MB_extractor DML Block is used to generate two outputs. You need to define and activate two separate Maps to fill these two different documents.

  1. Open the context menu at the directory Maps in your project and select New -> Map.
  2. Create a new Map
  3. Follow the wizard and give the basic properties for the new Map.
  4. Select the Map type
    • File name: MR_webToPartner
    • Next
    • Select Input Business Document BD_orderFromWeb.bdoc
    • Select Output Business Document BD_orderToPartner.bdoc
    • Finish
    • The new Map is created and the Editor view is opened.
  5. In the Editor view, begin entering the expressions that convert data from input to output nodes.
  1. For the moment, enter expressions for only two nodes in the XML header. These nodes hold constants that specify the XML version and document encoding:
  2. Editor view
  3. In the expression field for:
  4. XmlVersion node, enter "1.0"
  5. XmlEncoding node, enter "ISO-8859-1"
  6. This is the simplest use of expressions: You enter the string literals that you want to input to the corresponding node.
  7. Using the same method, define a second Map that generates data for the billing system and routes the input document to the billing output of the DML Block.
  8. This time, include a variation: Place the values for the version and encoding nodes in variables.
  9. Define the required variables by using the context menu on the Extended Objects directory.
  10. Define the required variables by using the context menu on the Extended Objects directory
  11. In the following wizard give the name of the variable and Finish. After creating the variable double click on the new object version.var and enter the value of the variable into the opened editing view.
  12. Wizard to create the variable
  13. Repeat this for the encoding.
  14. After it is defined, the variables named version and encoding display in the Resource navigation panel under the Variables category. You can now use them to fill the XML header of the MB_billingDelivery Business Document within the MR_webToBilling Map, as in the following example:
  15. Variable example
  16. Notice the variables in the expression fields of node 2 (XmlVersion) and node 3 Map (XmlEncoding). Expressions are elementary: just the names of the variables introduced by the reserved character percent.

Create the Mapping Flow that process the data through the developed Business Documents and Maps

  1. Create a new Mapping Flow and name it ordertoPartner:
  2. Creating a new Mapping Flow
  3. Mapping Flow editor
  4. Left side: Resource view
  5. Upper right side: Editor view with panel view on the right
  6. Bottom right side: Properties view; other views can be displayed if needed
  7. From the panel put a Business Document into the editor select BD_orderFromWeb.bdoc and connect it with the input.
  8. Put a DML Block into the editor and name it MB1_extractor.
  9. Into this DML Block put two Maps. Select the two Maps, created before.
  10. Add two outputs and two more Business Documents into the editor. For the Business Documents, select the Documents BD_orderToPartner.bdoc and BD_billingDelivery.bdoc and then connect them with an output.
  11. After that connect the BD_orderFromWeb.bdoc with the MB1_extractor and the Mapwith the corresponding Business Documents from the output side.

Related topics

FoodBroker project: Do the first steps

Create a Business Document for the customer request

Create a Business Document for the partner

Create a Business Document for partner rates

Build the Mapping Flow

FoodBroker project: Fill headers

FoodBroker project: Determine the incoming order ID

FoodBroker project: Generate the order ID

FoodBroker project: First steps in filling nodes

FoodBroker project: Extra charge for VISA payments

FoodBroker project: Introduction to data aggregation

FoodBroker project: Collect and copy parts

FoodBroker project: Manage rates

FoodBroker project: Handle absence of partner rates

Related Links