5.8.3 Modifying the Hello service adapter

The CustomFunction sample program changes the case of alphabetic data to uppercase when calling a service via the service adapter. To implement this processing, you need to define data transformation in the Hello service adapter by modifying the definition of the Hello service adapter.

The following is the procedure for modifying the Hello service adapter.

  1. From the Eclipse menu, select Window, and then Preferences.
    The Preferences dialog box appears.
  2. In the left pane, select HCSC-Definer, and then Data Transformation.
    The setting items that are specified in the data transformation definition window are displayed.

    [Figure]

  3. Click the Custom Function tab.
    The Custom Function tab in the Preference dialog box opens.

    [Figure]

  4. Click the Browse button.
    The dialog box for selecting a file opens.
  5. Select the transformation function definition file that you created in 5.8.2(1) Creating the transformation function definition file, and then click the OK button.
    The transformation function definition file is selected.

    [Figure]

  6. Click the OK button.
    The transformation function definition file is registered.
  7. Click the HelloServiceAdapter tab.
    The service adapter definition (standard) window defined during development of the Hello service adapter appears.

    [Figure]

  8. In the Request message area, in the Standard group, select the Use check box. Then, for Format ID, Message format, and Data-conversion definition, set the values listed below.

    [Figure]

    No.ItemValue to be set
    1Format IDhello01
    2Message formatservice-platform-installation-directory\CSCTE\Samples\CustomFunctions\CustomFunction\Schema\HelloService.xsd
    3Data-conversion definitionTRANSFORM
  9. Click the Edit button.
    The Select Root Element dialog box appears.
  10. As the root elements for Source and Destination, select the following values from the drop-down list:
    • Root element of HelloService.xsd (schema logical name) for Source: hls:getHelloString
    • Root element of cscformat1.xsd (schema logical name) for Destination: hls:getHelloString

      [Figure]

  11. Click the OK button.
    The data transformation definition window appears.

    [Figure]

  12. On the palette of the data transformation definition window, click custom. Then, on the canvas, click between the transformation source and destination to place the custom there.

    [Figure]

  13. On the palette of the data transformation definition window, click const. Then, on the canvas, click between the transformation source and destination to place the const there.

    [Figure]

  14. On the palette of the data transformation definition window, click Mapping.
  15. Click the node adapter of the transformation-source node as the mapping source.
  16. Click custom as the mapping destination.
    A mapping line is set.
  17. In the same way as steps 14 to 16, set a mapping line from custom to the node adapter of the transformation-destination node.
  18. In the same way as steps 14 to 16, set a mapping line from const to custom.

    [Figure]

  19. On the palette of the data transformation definition window, click Select.
  20. On the palette of the data transformation definition window, double-click const.
    The Set Constant dialog box appears.
  21. Select String, and then enter upper.

    [Figure]

  22. Click the OK button.
    The Set Constant dialog box closes.
  23. In the data transformation definition window, double-click custom.
    The Custom dialog box appears.
  24. Click the Select Transform function button.
    The Select Transform function dialog box appears.

    [Figure]

  25. In the transformation function tree, select String changeCase(text,flag), and then click the OK button.
    The Select Transform function dialog box closes, and then the Custom dialog box re-appears.

    [Figure]

  26. Confirm that Argument name and Input value are defined as shown below.
    If the combination of Argument name and Input value is different from the combination shown below, use the Up Input value or Down Input value button to combine them correctly.
    No.Argument nameInput value
    1text/hls:getHelloString/hls:InputString
    2flag{const1}
  27. Click the OK button.
    The Custom dialog box closes.
  28. From the Eclipse menu, select File, and then Save.
    The Hello service adapter has now been modified completely.
  29. Validate and package the modified service adapter.
    For details about validation and packaging, see 5.3.2 Validating and packaging a service adapter.
  30. Define deployment of the modified service adapter.
    For details about deployment definitions, see 5.3.3 Defining deployment of a service adapter.