Applying functions

You can apply functions on the item types of a schema to define the component rules.

Before you begin

You must have a defined schema in a schema designer. See Schema design overview.

About this task

You can also apply functions on the types of the imported JSON or XSD schemas.


  1. Select your project in HCL OneTest Server and go to the Data Fabrication page.
  2. Click Schemas, and then select the schema for which you want to generate the test data.
  3. Select the group type, and then open the structural view of the schema.
  4. Select the item type on which you want to apply the function, in the Structure dialog box.
  5. Click the menu on the right side of the Structure dialog box.
    A blank field is displayed next to the item type.
  6. Click the blank field.
    The Rule Editor pane is displayed on the page.
  7. Enter the equal sign (=) in the Rule Editor pane.
  8. Provide the function in the Rule Editor pane.

    You can enter the function by performing any one of the following methods:

    • Enter the function manually.
    • Select from the list of functions by using the following steps:
      1. Click the Insert mapping functions icon Function.
      2. Select the function that you want to apply as a component rule, and then click Insert from the menu of the selected function.

    For example, if you want the generated value of an item type in uppercase, then you must enter or select the UPPERCASE() function.

  9. Optional: Enter a parameter for the selected function.

    You can provide the parameter value either as a constant value or as a reference of the item type.

    You must use the following syntax to provide the parameter in any function:

    <item type name>:Out1


    • item type name - Represents the name of the item type.
    • :Out1 - Represents a standard output argument.

    For example, consider that you have a group type as Flowers with Colors and Pattern as two item types. If you want to generate the value of Colors item type in uppercase, then you can select the item type Pattern in the Structure dialog box. You must open the Rule Editor pane, and then select the UPPERCASE() function with reference of Colors item type as the parameter.

    = Uppercase (Colors:Out1)

  10. Press Enter.
    The selected function is displayed in the item type field of the Structure dialog box.
  11. Save the changes.


You have successfully applied the function on an item type of the schema.

What to do next

You can generate the test data for the designed schema. See Generating test data.