You can use the Create transform to initialize an output element, set an output element to nil, or set an output element to fixed value defined by the schema.
For simple types, you cannot use the value of an input element to set the value of an output element in a Create transform.
However, you can define zero or more supplement connections between input elements and the Create transform. You can then use these input elements in a conditional expression that defines the condition under which the transform should be applied.
By default, the option Create empty is preselected. This is the option that you must choose to initialize a single type output element.
The following figure shows the properties view for the Create transform defined for that element:
For example, if the output element is defined in the schema model as <element name="Postcode" type="string" nillable="false" />, you can only choose to create the output element as empty.
The option to create a nil element is available only when the target is nillable.
The option to create a element with the default value is only available when the target has a default value defined in the schema file.
By default, the option Create empty is preselected. This is the option that you must choose to initialize complex output element.
When you define a Create transform to initialize a complex type output element, a nested map is created containing the complex structure elements. You configure each element within the nested map individually, that is, you initialize, set to nil, or set to a default value each individual element.
When you initialize a complex type, you can use the nested map associated with the Create transform to provide values for the child element. You can define and configure each element by using transforms that do not require an input, for example the Assign transform, an xs:type transform, or the Create transform. You can also wire supplemental input to enable you to Move input values to the child elements.
When you define a Create transform to set to nil a complex type output element, a nested map is created containing the complex structure elements. You can get the error Transform contains nested errors if you try to configure any element within the nested map individually.
You must specify how an output element or an attribute is created in the General tab of the Create transform properties view.
The following table lists simple data types, their default options preselected when you define a Create transform, and list of options you can choose to set the value of an output element of that type:
Data type | Default option | Output element can be set to empty | Output element can be set to nil (the element is defined as nillable="true") | Output element can be set to fixed or default value (the default property is set in the schema) |
---|---|---|---|---|
String | Create empty | valid | valid | valid |
Integer | Create nil | not valid | valid | valid |
boolean | Create nil | not valid | valid | valid |
date | Create nil | not valid | valid | valid |
dateTime | Create using default or fixed value defined by schema for target type | not valid | not valid | valid |
double | Create using default or fixed value defined by schema for target type | not valid | not valid | valid |
float | Create using default or fixed value defined by schema for target type | not valid | not valid | valid |
hexBinary | Create empty | valid | valid | valid |
int | Create using default or fixed value defined by schema for target type | not valid | not valid | valid |
time | Create using default or fixed value defined by schema for target type | not valid | not valid | valid |
For example, for the following schema definition of an output element:
<element name="NewAddress" type="boolean" nillable="true" />
When you define a Create transform to set the value of a boolean element, you can only create the element as nil.
For example, for the following schema definition of an output element:
<element name="NewAddress" type="boolean" nillable="false" />
When you define a Create transform to set the value of a boolean element, you can only specify a fixed value, and the choice is preselected.
You can define supplement connections between input elements and the Create transform. You can then use these input elements in a conditional expression that defines the condition under which the transform should be applied. If the condition evaluates to true, the transform is applied.
For more information on how to configure these properties, see Configuring a mapping transform properties.