Task 6: How to Specify Routing Rules

You must specify the path that messages take from the readFile adapter service to the external reference.

To specify routing rules

  1. Connect the LookupMultiplevaluesMediator Mediator to the writeFile reference, as shown in Figure 45-24.

    Figure 45-24 LookupMultiplevaluesMediator Mediator Connected to the writeFile Reference

    Description of Figure 45-24 follows
    Description of "Figure 45-24 LookupMultiplevaluesMediator Mediator Connected to the writeFile Reference"
  2. Double-click the LookupMultiplevaluesMediator Mediator.
  3. To the right of the Transform Using field, click the icon.

    The Request Transformation Map dialog appears.

  4. Select Create New Mapper File and click OK.

    An Input_To_Output_with_multiple_values_lookup.xsl file appears in the XSLT Mapper.

  5. Drag and drop the imp1:Root-Element source element to the ns2:Root-Element target element.

    The Auto Map Preferences dialog appears.

  6. From the During Auto Map options list, deselect Match Elements Considering their Ancestor Names.
  7. Click OK.

    The Input_To_Output_with_multiple_values_lookup.xsl file appears in the XSLT Mapper, as shown in Figure 45-25.

    Figure 45-25 imp1:Root-Element To ns2:Root-Element Transformation

    Description of Figure 45-25 follows
    Description of "Figure 45-25 imp1:Root-Element To ns2:Root-Element Transformation"
  8. In the Components window, select Advanced.
  9. Click DVM Functions.
  10. Drag and drop lookupValue1M in the center panel, as shown in Figure 45-26.

    Figure 45-26 Adding lookupValue Function to imp1:Root-Element to ns2:Root-Element

    Description of Figure 45-26 follows
    Description of "Figure 45-26 Adding lookupValue Function to imp1:Root-Element to ns2:Root-Element"
  11. Double-click the lookupvalue1M icon.

    The Edit Function-lookupValue1M dialog appears.

  12. To the right of the dvmLocation field, click Search.

    The SOA Resource Lookup dialog appears.

  13. Select multivalue.dvm and click OK.
  14. To the right of the sourceColumnName field, click Search.

    The Select DVM Column dialog appears.

  15. Select Longname and click OK.
  16. In the sourceValue column, enter the following:

    /imp1:Root-Element/imp1:Details/imp1:Longname.

  17. To the right of the targetColumnName field, click Search.

    The Select DVM Column dialog appears.

  18. Select Shortname and click OK.
  19. Click Add.

    A targetColumnName row is added.

  20. In the targetColumnName field, enter "Language".
  21. Click Add to insert another targetColumnName row.
  22. In the targetColumnName field, enter "Capital".

    The Edit Function-lookupValue dialog appears, as shown in Figure 45-27.

    Figure 45-27 Edit Function-lookupValue Function Dialog: Multiple Value Lookup Use Case

    Description of Figure 45-27 follows
    Description of "Figure 45-27 Edit Function-lookupValue Function Dialog: Multiple Value Lookup Use Case"
  23. Click OK.

    The Transformation appears, as shown in Figure 45-28.

    Figure 45-28 Complete imp1:Root-Element To ns2:Root-Element Transformation

    Description of Figure 45-28 follows
    Description of "Figure 45-28 Complete imp1:Root-Element To ns2:Root-Element Transformation"
  24. From the File menu, select Save All and close the Input_To_Output_with_multiple_values_lookup.xsl file.