FoodBroker project: First steps in filling nodes

Now that you know how to collect input data and use it to generate values, you can fill some more output nodes of the MB_extractor .

Start with the Map that generates the document for the partner restaurant. Fill the recipient part with copies of supplier fields from the input. The following table lists the mapping of data from input to output node:

node in output filled with node from input

\order\fax

\order\supplier\address\fax

\order\caption\recipient\name

\order\supplier\name

\order\caption\recipient\phone

\order\supplier\address\phone

\order\caption\recipient\fax

\order\supplier\address\fax

In this table, the usual path syntax is used. You can easily translate information to fill the appropriate expression fields in the MR_webToPartner Map.

Filling the appropriate expression fields in the Map editor

Now that you have almost filled the nodes of the BD_orderToPartner, switch to the other output of your DML Block, the BD_billingDelivery Business Document.

What is interesting in filling BD_billingDelivery is the computing of the charge fees and amounts. Computing the node amount requires you to go through all the occurrences of node line. If the value is available in the variable amount, then you can exhibit the expression that computes the value of charges that is 5% of order total as follows:

%amount * 0.05

In addition, you are able to compute the partner_fees value from the value of the amount variable and the rate node of input rates:

%amount * 0.05 * rates:\partner\name[where item =
order:\Root\order\supplier\name]\..\rate

This expression selects the rate from input rates XML document using the supplier name found in the input order document. Then, the grand total is quite simple:

%amount * 1.05

Notice that computing the field total is done only from the input. In Maps, you cannot use the output you are currently building, even if total is basically the sum of amount and charges, you cannot compute it that way.

The values for mapping the remaining nodes of BD_billingDelivery are copied directly from the nodes with the same names in BD_orderFromWeb. To tell the integration engine to perform such copies, you enter the paths to the source nodes as elementary rules in the Map.

This is possible for nearly every node of the output. An upcoming chapter describes how to handle the case of multiply occurring nodes (nodes with cardinality 1..n or 0..n).

The following graphic illustrates what your Map should look similar to at this point:

Expected Map

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