Choosing a transform to set the value of a complex output element

You can use different transforms, such as Move, Create, Assign, to set the value of a complex output element.

Procedure

Complete the questionnaire to identify the transform that you can use to set the value of a complex output element:

  1. Do you want to set the value to a fixed value?

    Use the Assign transform.

  2. Do you want to initialize the output element, that is, do you want to create an empty structure?

    Use the Create transform.

  3. Do you want to create a nil output element?

    Use the Create transform and verify that the output element is defined as nillable="true" in the schema.

  4. Do you want to set the output element as nil by using an input element with a value of nil?

    Use the Move transform. Verify that the input element is defined as nillable="true" in the schema. Ensure that the value of the input element is nil.

  5. Do you want to set the output element to a default value?

    Use the Create transform and verify that the output element has a default value set in the schema.

  6. Do you want to set the output element with input from a database column?

    Use the Select transform to obtain the database input value. Then, in the nested map that is associated with the Select transform, use the Move transform to set the values of the output element.

  7. Do you want to set the value of the output element with the value of an input element? Do the input element and the output element have the same type associated? Do you want to cast the input value to the type of the output value?
    • When the input and output element have the same type, use the Move transform.
    • When the input and output element have different data types, use the xs:type transform to set the value of each element.
  8. Do you want to apply the transform always? Do you want to apply the transform when a condition based on input data occurs?

    Define a conditional expression for the transform you choose. This expression determines when the transform is applied. For more information, see Defining an XPath conditional expression for a transform.

Results

Table 1. Setting the value of a complex output element
  Number of input elements that are required to set the value of the output element Transforms to set a complex type
Set the output element with a fixed value 0 Assign
Initialize the output element 0 Create
Set the output element as nil 0 Create

Condition: The output element is defined as nillable="true" in the schema.

Set the output element as nil by using a nil input element 1 Move

Condition: The input element must be defined as nillable="true" in the schema.

Set the output element with a default value 0 Create

Condition: The output element has a default value set in the schema.

Set the output value from a database table column 1..N Select transform to obtain the database input value and Move transform to set the value
Copy the value of the input element to the output element (both elements have the same data type) 1 Move
Copy the value of the input element to the output element (elements have different data types) 1 xs:type

What to do next

Learn about the transforms. For more information, see Transform types in the Graphical Data Mapping editor.