Rational Developer for System z

Step 4.4: Set the input parameters for the nonterminal application

In this section you create mappings that set the values of the input parameters for the nonterminal application DFH0XCMN, which is invoked by the Invoke screen operation node PlaceOrder.
The nonterminal application DFH0XCMN expects the following input parameters:

Create an Assign node for the mappings

In this subtopic you add to CatalogOrder.seqflow a new Assign node to contain the mappings that set the values of the input parameters to DFH0XCM.

To add the Assign node:

  1. If CatalogOrder.seqflow is not already open in the flow editor then:

    1. Open CatalogOrder.seqflow in the flow editor.

    2. In the workbench's main menu click View > Zoom Out.

  2. Add a new Assign node immediately to the right of the Switch node named Switch. The new Assign node is named Assign1.

  3. Create a connection from the first output terminal of Switch to the input terminal of Assign1:

  4. Create a connection from the output terminal of Assign1 to the input terminal of PlaceOrder.

  5. Close the flow editor.

Input and output parameters in the same message

Notice that the operation PlaceOrder, instead of having a separate input message for the input parameters and a separate output message for the output parameters, has its input and output parameters stored in the same message.

You can see these references by opening the operations file new_programs.wsdl and examining the values for Input message and Output message (see Figure 1).
Figure 1. Contents of the operations file
Contents of operation PlaceOrder

The reference to the Input message and the reference to the Output message both refer to the same message msg_DFH0XCMN_DFHCOMMAREA.

Create mappings for the input parameters

Note: For syntax such as i_CatalogOrder.itemNumber see Note on "<Message>.<element>".

In this subtopic you add the five mappings shown in Table 1 to the mapping routine for the Assign node Assign1 in the flow CatalogOrder.seqflow. These mappings set up the input parameters for the nonterminal application DFH0XCMN:

Table 1. Mappings for the mapping routine of Assign1
Source information for the mapping: Target variable of the mapping: Type of mapping:
Name: Data type: Name: Data type:
v_CatalogOrder.itemNumber xsd:short

msg_DFH0XCMN_DFHCOMMAREA
      .CA_ORDER_REQUEST
      .CA_ITEM_REF_NUMBER

short Move
v_CatalogOrder.itemQuantity xsd:short

msg_DFH0XCMN_DFHCOMMAREA
      .CA_ORDER_REQUEST
      .CA_QUANTITY_REQ

short Move
The string 01ORDR Literal string

msg_DFH0XCMN_DFHCOMMAREA
      .CA_REQUEST_ID

string Assign
The string JOE Literal string

msg_DFH0XCMN_DFHCOMMAREA
      .CA_ORDER_REQUEST
      .CA_USERID

string Assign
The string DEPT Literal string

msg_DFH0XCMN_DFHCOMMAREA
      .CA_ORDER_REQUEST
      .CA_CHARGE_DEPT

string Assign

To create these mappings:

  1. Open CatalogOrder.seqflow in the flow editor, if it is not already open.

  2. In the main menu of the workbench click View > Zoom Out.

  3. Open the mapping routine for the Assign node Assign1:

    1. Right-click Assign1.

    2. Click Open Mapping Routine. The mapping editor opens and displays the mapping routine for Assign1.

  4. Add v_CatalogOrder to the mapping routine as a source message:

    1. On the mapping routine toolbar click the Add a source message Add a source message icon. The Select Message window opens.

    2. In the Select Message window:
      1. Click CatalogSample > CatalogSample.Interface > Messages > v_CatalogOrder.sfmxsd > v_CatalogOrder.
      2. Click OK.

      The source message is added to the left side of the mapping routine area.

  5. Add msg_DFH0XCMN_DFHCOMMAREA to the mapping routine as a target message. (This message is the input message used by the operation PlaceOrder).

    1. On the mapping routine toolbar click the Add a target message Add a target message icon. The Select Message window opens.

    2. In the Select Message window:
      1. Click CatalogSample > CatalogSample.Nonterminal > Messages > dfh0xcmn.sfmxsd > msg_DFH0XCMN_DFHCOMMAREA.
      2. Click OK.

      The target message is added to the right side of the mapping routine area.

  6. Create a mapping that copies the contents of v_CatalogOrder.itemNumber into msg_DFH0XCMN_DFHCOMMAREA.CA_ORDER_REQUEST.CA_ITEM_REF_NUMBER.

    1. Drag v_CatalogOrder.itemNumber on the left side of the mapping routine area to msg_DFH0XCMN_DFHCOMMAREA.CA_ORDER_REQUEST.CA_ITEM_REF_NUMBER on the right side of the mapping routine area.

    The mapping editor creates a Move transform that copies the contents of the source variable into the target variable.

  7. Create a mapping that copies the contents of v_CatalogOrder.itemQuantity into msg_DFH0XCMN_DFHCOMMAREA.CA_ORDER_REQUEST.CA_QUANTITY_REQ.

    1. Drag v_CatalogOrder.itemQuantity on the left side of the mapping routine area to msg_DFH0XCMN_DFHCOMMAREA.CA_ORDER_REQUEST.CA_QUANTITY_REQ on the right side of the mapping routine area.

    The mapping editor creates a Move transform that copies the contents of the source variable into the target variable.

  8. This tutorial uses the string 01ORDR as the request id. Create a mapping that stores the string 01ORDR into the target element msg_DFH0XCMN_DFHCOMMAREA.CA_REQUEST_ID:

    1. On the target side of the mapping routine area right-click msg_DFH0XCMN_DFHCOMMAREA.CA_REQUEST_ID.

    2. Click Create Transform.

    3. Click the transform Assign if it is not already selected.

    4. In the Properties view:
      1. Click the General tab.
      2. In the Value field type the string 01ORDR without quotation marks and press Enter.
  9. This tutorial uses the string JOE as the user ID. Create a mapping that stores the string JOE into the target element msg_DFH0XCMN_DFHCOMMAREA.CA_ORDER_REQUEST.CA_USERID:

    1. On the target side of the mapping routine area right-click msg_DFH0XCMN_DFHCOMMAREA.CA_ORDER_REQUEST.CA_USERID.

    2. Click Create Transform.

    3. Click the transform Assign if it is not already selected.

    4. In the Properties view:
      1. Click the General tab.
      2. In the Value field type the string JOE without quotation marks and press Enter.
  10. This tutorial uses the string DEPT as the department ID. Create a mapping that stores the string DEPT into the target element msg_DFH0XCMN_DFHCOMMAREA.CA_ORDER_REQUEST.CA_CHARGE_DEPT:

    1. On the target side of the mapping routine area right-click msg_DFH0XCMN_DFHCOMMAREA.CA_ORDER_REQUEST.CA_CHARGE_DEPT.

    2. Click Create Transform.

    3. Click the transform Assign if it is not already selected.

    4. In the Properties view:
      1. Click the General tab.
      2. In the Value field type the string DEPT without quotation marks and press Enter.
  11. Close the mapping editor.

  12. Close the flow editor.


Feedback