FoodBroker project: Generate the order ID

Both the BD_orderToPartner Business Document and the BD_billingDelivery Business Document have an order_id node. However, it is defined as a string in BD_orderToPartner. The expression that computes the order ID in this document is different from the one of the previous chapter.

Use the content of the now variable, but this time it is processed as a string via implicit conversion from integer:

dayOfYear(%now) + getStringRight("00" + getHours(%now), 2)
                + getStringRight("00" + getMinutes(%now), 2)
                + getStringRight("00" + getSeconds(%now), 2)

The results of the call to getHours is converted to a string because it is concatenated to another string. To match the results of the previous chapter, hours, minutes, and seconds need to always be two digits long. To accomplish this, two leading zeros are added to each result and then the result string is cut to a length of two characters.

Enter the above expression in the Expression field of the orderid node in the MR_webToPartner Map.

Entering the expression in the Expression field

In this Business Document, the sender information is always the same and is written to the node via string literals:

Sender information is  written to the node via string literals

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