Rational Developer for System z

Case Mapping transform

The Case Mapping transform generates a value obtained by evaluating a specified case statement.

To specify values for a Case Mapping transform:

  1. Verify that the type of the transform that is selected in the mapping routine area is Case Mapping.

  2. In the Properties view, select the General tab.

  3. In the General tab:

    1. 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).
    2. In the table of cases, specify the valid cases and the default case.

      Valid cases: To specify a valid case:

      1. Click Add Case. The Edit Case window opens.

      2. In the Edit Case window:
        1. In the Case input field, specify a value that the case expression can resolve to.
        2. 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).

      3. 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

      1. In the table of cases, select <default case>.

      2. Click Edit case. The Edit Case window opens.

      3. In the Edit Case window:
        1. The Case input field is disabled because this is the default case.
        2. 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).
      4. Click OK.

    3. 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:

  1. The runtime environment evaluates the case expression and obtains a result.

  2. 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.

  3. Otherwise, the runtime environment moves the output value specified for the default case into the target element.


Feedback