The Case Mapping transform generates a value obtained by
evaluating a specified case statement.
To specify values for a Case Mapping transform:
Verify that the type of the transform that is selected in the
mapping routine area is Case Mapping.
In the Properties view, select the General tab.
In the General tab:
- In the Expression to evaluate field, type
the case expression that you want to use:
- The result of evaluating this expression is used to select a case
from the table of cases.
- This expression can be any valid expression and can evaluate to
any valid simple type.
Tip: ESQL validation and content assist
are available here in the same way as they are in the
Condition input
field on the
Condition tab (see
Specifying a condition for a mapping).
-
In the table of cases, specify the valid cases and the default
case.
Valid cases: To specify a valid case:
Click Add Case. The Edit
Case window opens.
In the
Edit Case window:
- In the Case input field, specify a value
that the case expression can resolve to.
- In the Value input field, specify the value
that you want to be stored into the target element of the mapping
if the case expression resolves to the value in the Case input
field.
Tip: ESQL validation and content
assist are available here in the same way as they are in the
Condition input
field on the
Condition tab (see
Specifying a condition for a mapping).
Click OK.
The values that you specified for the Case field
and the Value field are displayed in the table
of cases.
Default case: To specify a value for the default
case
In the table of cases, select <default case>.
Click Edit case. The Edit
Case window opens.
In the
Edit Case window:
- The Case input field is disabled because
this is the default case.
- In the Value input field, specify the value
that you want to be stored into the target element of the mapping,
if the case expression resolves to a value that does not match the Case value
of any of the valid cases.
Tip: ESQL validation and content
assist are available here in the same way as they are in the
Condition input
field on the
Condition tab (see
Specifying a condition for a mapping).
Click OK.
- You can also use the following controls:
Edit case: Click this button to revise
the values of the currently selected case.
Remove case: Click this button to delete
the currently selected case. (Ctrl-Z restores the deleted case.)
Reorder: Click the up arrow or the down
arrow to move the currently selected case to a different row of the
table. The default case cannot be moved (it is always the last case).
At runtime:
The runtime environment evaluates the case expression and obtains
a result.
If the result of the evaluation matches a valid case, then
the runtime environment moves the output value specified for that
valid case into the target element.
Otherwise, the runtime environment moves the output value specified
for the default case into the target element.