FoodBroker project: Determine the incoming order ID

To make the complete processing chain work properly, the company staff decided to include an identifier for each order submitted by customers. This order ID must be computed by the DML Block and the result inserted in each output whether it be partneror billing.

To determine the order ID, use a very simple technique: The current date and time are mapped to a whole number value as shown in the following expression:

  1000000*dayOfYear(%now)  + 10000*getHours(%now)
+     100*getMinutes(%now) + getSeconds(%now)

In this case, built-in functions are used to extract the components of the date from the variable now. You must define this variable, setting the initial value to the current date. To do this, invoke the GetDateAndTime() function. Since variables are reset at each new incoming message, each ID is different.

A whole number value is then computed using built-in functions that extract parts of the date. If this expression is evaluated at 19:34:32 on 2007, October 13rd, the returned ID would be: 289193432.

Create the variable now and fill it with the expression as you can see in the following picture:

Filling the variable with the expression

Enter the above expression in the MR_webToBilling Map you defined previously. You associate the expression with the orderid node as illustrated in the following graphic:

Associate the expression with the orderid node

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