Skip to main content Skip to complementary content

Using external map variables in a map

Create a map that uses an existing external map variable and defines new ones to be used in your Route.

Procedure

  1. In your Route, double-click the cMap component.
  2. In the first step of the wizard that opens, select your input structure and click Next.
  3. In the second step, select your output structure and click Finish.
    A map is generated and opens in the editor. You can now configure it.
  4. Drag the input orders element on the output orders element.
    All elements in the input are automatically mapped with the corresponding elements in the output.
  5. From the Functions tab, place a Multiply function on the itemTotal element.
  6. Place the output price element on the First Value argument and the output quantity element on Second Value.
    Placement of elements.
  7. Place an AgSum function on the orderTotal element, then place the itemTotal element on the AgSum function.
  8. Place a GetValueFromExternalMap function on the orderDate element, place a Constant function on the Key argument, then double-click the Constant function and enter current.date in the Value field.
    This configuration allows you to retrieve the value from the variable you created in the first cProcessor component of your Route.
    Placement of functions.
  9. Place an AddToDateTime function on the shippingDueDate element, double-click the function and select Days in the Add what? drop-down list.
  10. Place a Constant function on the Amount argument and set its value to 5.
  11. Place the output orderDate element on the DateTime Value argument.
  12. Open the Util tab of the shippingDueDate element and place a PutValueToExternalMap function in it.
  13. Place a Constant function on the Key argument and set its value to due.date.
  14. Place the shippingDueDate element on the Value argument.

    This allows you to create an external map variable named due.date with the value of the shippingDueDate element.

    Placement of shippingDueDate element.
  15. Click the output orderId element, open its Util tab and repeat the previous steps to create a variable named order.id.
    Creation of order.id variable.
  16. Save your map.

Results

Your map is now configured. You can run your Route to see the result. In this example, the result looks like this:
Route result.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!