Components > Hierarchical mappers > Statements
  

Statements

A statement defines how hierarchical input in the source schema is mapped to hierarchical output in the target schema. When you drag a source element to a target element, the hierarchical mapper generates a statement that you can edit.
You can create a statement for each source element, or you can nest statements to make them dependent on other statements. A statement can be a parent to a group of child statements where each time the parent statement runs, the child statements run as well. Child statements appear indented below the parent statement.
You can create a statement by dragging a source element to a target element. The hierarchical mapper identifies the statement type, input, and output, generates a statement, and validates it. You can also manually add and configure statements. To delete a statement, click Delete or select the link between the source and target schema and press Delete.

Statement types

Each statement type represents the type of elements that are mapped between the source and target schemas. In the case of a Router statement, the statement type represents the action to take to map the elements.
You can define the following types of statements:
Map
A Map statement links a simple source element to a simple target element.
Group
A Group statement links a complex source element to a complex target element.
Repeating Group
A Repeating Group statement links a repeating complex source element to a repeating complex target element.
Router
A Router statement uses conditions to evaluate each source element and process it based on the input value.
Option
An Option statement defines a condition in a Router statement. If the condition evaluates to true, the hierarchical mapper runs the Option statement.
Default
A Default statement defines the default statement to run in a Router statement if none of the Option statements apply.

Map statement

A Map statement links a simple source element to a simple target element. The input must be a single value or a constant value. A Map statement can be a child of a Group, Repeating Group, or Option statement.
A Map statement can be a simple mapping between two elements such as a name element in the source and a name element in the target, or it can be complex mapping that uses expressions. For example, you want to map the Id, FirstName, and LastName elements in the source schema to the Name attribute in the target schema. You can configure a Map statement with the input expression concat(Profile/Id, "-", Profile/FirstName, "-", Profile/LastName) and the output expression @Name.

Group statement

A Group statement links a complex source element to a complex target element. You can nest other statement types as children of the Group statement.
You can use a Group statement to provide a common context for all the child statements to pass or fail simultaneously. You can also use a Group statement to help you organize or simplify other statements.
For example, you want to map an Employee parent element in the source schema to a Worker parent element in the target schema where both parent elements contain nested child elements such as FirstName and LastName. You can create a Group statement to map the Employee parent element to the Worker parent element, and you can create nested Map statements to map the child elements of the Employee parent element to the child elements of the Worker parent element.
The following image shows the how the elements are mapped in a hierarchical mapper:
A hierarchical mapper maps an Employee source schema to a Worker target schema. The source schema contains an Employee parent element with id, FirstName, LastName, Role, and StartDate child elements. The target schema contains a Worker parent element with FirstName, LastName, FullName, Id, and YearsOfService child elements.
The following image shows the Group statement and the nested Map statements:
The statements include a Group statement with nested Map statements. The Group statement maps the Employee element to the Worker element. The Map statements map the Id, FirstName, LastName elements in the source schema to the elements with the same name in the target schema. The Map statements also map the StartDate element in the source schema to the YearsOfService element in the target schema.

Repeating Group statement

A Repeating Group statement links a repeating complex source element to a repeating complex target element. The Repeating Group statement runs each time the source element appears in the source schema.
A Repeating Group statement contains iterated Map statements. The input to the Repeating Group is an expression that evaluates to a sequence of elements or values.

Router, Option, and Default statements

A Router statement uses conditions to evaluate each source element and process it based on the input value.
A Router statement contains one or more Option statements and one Default statement. When the hierarchical mapper processes a source element, it runs only the Option statement with a condition that matches the input value. If none of the conditions match the input value, the hierarchical mapper runs the Default statement.
For example, you're hiring employees for your organization and you want to map their skills to the compensation scores in their employee profiles. You can use a Router statement with Option statements that evaluate whether a candidate has Skill A or Skill B and assign the appropriate compensation score. If a candidate has neither skill, a Default statement runs to assign the compensation score.
The following image shows the Router statement and the nested Option and Default statements:
The statements in the hierarchical mapper include a Router statement with two nested Option statements and a Default statement. The first nested Option statement contains a nested Map statement.

Statement properties

A hierarchical mapper automatically configures statement properties when it generates a statement, but you can edit the statement properties or manually configure a statement.
To add or remove rows, use the Settings button. You can also search for a statement using a string. When you select the row for a statement, the corresponding mapping is highlighted in the Hierarchical Mapper area. Similarly, when you select an element in the hierarchical mapper, the corresponding statement is highlighted in the Statements area.
The following table describes the statement properties:
Property
Description
Row
Row number to identify the statement. The row number is generated automatically.
Name
Name to identify the statement. You can change the name at any time, and the statement name doesn't need to be unique. You can use the statement name to help you find the statement in the session log.
Statement Type
Type that defines how the statement runs when a source element appears in the source schema.
Input
XPath or expression consisting of XPaths that defines the input element in the source schema. The expression can evaluate to an element or to a value.
Condition
XPath or expression consisting of XPaths that defines a condition to map the source element to the target element.
For example, normalize-space(string(.)) = 'A'
Skip Missing Input
Determines whether to skip the mapping statement if the input expression doesn't match an element in the source schema. Choose one of the following options:
  • - Enabled. If the source element doesn't exist, the hierarchical mapper skips the statement without error.
  • - Disabled. If the source element doesn't exist, the statement fails.
Default
Default value to set the value of the target element if the hierarchical mapper can't find the source element.
On Fail
Determines what to do if the statement fails. Choose one of the following options:
  • - Skip Statement. If the statement fails, skip the statement.
  • - Skip Iteration. If the statement fails and it's part of a group, skip every iteration of the statement.
  • - Propagate. If the statement fails, the parent statement also fails.
Output
XPath or expression consisting of XPaths that defines the output element in the target schema.
Mode
Determines whether the hierarchical mapper adds an output element to the target schema or matches the value of the output expression to an existing element in the target schema. Choose one of the following options:
  • - Add. Creates an element in the target schema. If the element is not a multiple-occurring element and the element already exists in the target schema, the statement fails.
  • - Match. Matches the value of the output expression to an existing element in the target schema. If the element doesn't exist, the statement fails.
  • - Match or Add. If the value of the output expression exists in the target schema, the hierarchical mapper matches the output to the target element. If the element doesn't exist in the target schema, the hierarchical mapper creates an element in the target schema.
Comments
Comments that you want to make about the statement.