Rational Developer for System z, Version 7.6

Step 1.2: Define the input, output, and variable messages for the top-level flow

In this step you will define an input message, an output message, and a variable message for the top-level flow.

About messages

In the service flow project tools a message is a named data area in which you can define one or more data elements (called message elements) that are used by your flow. Typically a flow uses not just one message but at least three distinct messages, each of which is stored in a separate message file, as shown in the following table:
Table 1. Types of message used in a flow
Message: Description: Where stored:
Input message Contains the input parameters passed to the flow by the calling program. Input message file
Output message Contains the output parameters returned to the calling program by the flow. Output message file
Variable message Contains the variable elements used by the flow while it is being performed. Variable message file
See General information about how messages are used in flows.
Although structurally a message file can contain multiple messages, for functional reasons the service flow project tools impose the following restrictions:
  • The input message file must contain only one message, the input message.
  • The output message file must contain only one message, the output message.
  • The variable message file can contain multiple messages.
See How messages are used in flows.

The term variable is used to refer to a message element of a simple type (see General information about how messages are used in flows).

When you generate runtime code for the service flow, the runtime code generator uses your message definitions to allocate space for the data elements accessed by the flow.

Define the input message

Tip: As with most editors in the product, when you are working in the flow message editor you can save the current contents of the editor at any time by pressing Ctrl-S.
The input message of the top-level flow contains two message elements:
Note: Because these two message elements are a simple type (string) they can also be called variables.
  • The itemNumber message element, used to contain the identifying number of the item to be ordered.
  • The itemQuantity message element, used to contain the number of items to be ordered.

To define the input message:

  1. Create the input message file:
    1. In the EST Project Explorer, right-click the CatalogSample.Interface folder.
    2. Click New > Message Definition. The New Message Definition wizard opens.
    3. In the New Message Definition wizard:
      1. In the File Name field, type i_CatalogOrder.sfmxsd.
      2. Click Finish. The wizard performs the following actions:
        1. It creates the new message file.
        2. It opens the new message file in the flow message editor.

  2. Create the input message:
    1. In the flow message editor, at the bottom of the editor area, verify that the Basic tab is the topmost (i.e. active) tab.
    2. On the Basic tab, in the left pane:
      1. Right-click i_CatalogOrder.sfmxsd.
      2. Click Add Message. A new message with the default name message1 appears under i_CatalogOrder.sfmxsd.
        Note: You might have to expand i_CatalogOrder.sfmxsd to see this message.
    3. Rename the new message to i_CatalogOrder:
      1. Verify that the Properties group is visible in the right pane of the Basic tab. If it is not visible then widen the editor area until you see it.
      2. In the left pane click message1.
      3. In the Properties group, in the Name field, type the new name i_CatalogOrder.
  3. Add a message element itemNumber to the message:
    1. In the left pane, right-click the message i_CatalogOrder.
    2. Click Add Element. A default message element with the default name localElement1 is added to the message.
    3. Rename the new message element to itemNumber:
      1. In the left pane click localElement1.
      2. In the Properties group in the right pane, in the Name field, type itemNumber.
    4. Set the type of the itemNumber message element to xsd:short (equivalent to a signed short integer):
      1. At the bottom of the editor area click the Advanced tab.
      2. Click i_CatalogOrder.sfmxsd > Messages > i_CatalogOrder > itemNumber.
      3. On the same line as itemNumber, in the Type column, click the empty cell. The cell becomes a list.
      4. Scroll the list and select (New Simple Type Restriction). The New Simple Type Restriction window opens.
      5. In the New Simple Type Restriction window:
        1. In the Base Type list scroll the list and select xsd:short.
        2. Click OK to close the window.
    5. Define the range of the type as 0-9999:
      1. Verify that you are still using the Advanced tab of the editor.
      2. Click xsd:short under itemNumber.
      3. Click the Properties tab at the bottom of the editor area. The Properties information is displayed.
      4. In the left pane, click Logical Properties > Value Constraints.
      5. In the right pane, in the Inclusive Constraints area:
        1. In the Min field, type 0.
          CAUTION:
          When you type a value (such as 0) into a blank field (such as Min) in the Inclusive Constraints (or in the Length Constraints), and you then perform any action (such as clicking another field or pressing Ctrl-S) that causes the flow message editor to read the contents of the previously blank field (Min), then another node can temporarily become the active node in the flow message editor, causing the current data that is being displayed in the Properties tab to change suddenly. To navigate back to the right location:
          1. Click the Advanced tab.
          2. Click the message element type under the message element as you did before, for example, i_CatalogOrder.sfmxsd > Messages > i_CatalogOrder > itemNumber > xsd:short.
          3. Click the Properties tab as you did before.
          4. In the left pane, clickLogical Properties > Value Constraints as you did before.
        2. In the Inclusive Constraints, in the Max field, type 9999.
      Note: The reason for using the range 0-9999 is that in the CICS® example catalog application, on the Main Menu screen, the Order Item Number is 4 digits long. Thus the range is restricted to the size of the item number in the application.
    6. At the bottom of the editor area click the Basic tab.

  4. Add a second message element itemQuantity to the message:
    Because the steps required to create the second message element are very similar to the steps that you used to define the first input message element (itemNumber) the steps are described in a more streamlined fashion. In Table 2:
    • The Action column specifies the action that you are to perform;
    • The Item column specifies the item on which the action is to be performed;
    • The User interface column reminds you of the user interface in which the action takes place.
    1. To add the second message element:
      Table 2. Create the message element itemQuantity
      Action: Item: User interface:
      a) Click Basic tab Flow message editor
      b) Right-click i_catalogOrder.sfmxsd > i_CatalogOrder Flow message editor, Basic tab, left pane
      c) Click Add Element
      d) Click localElement1
      e) Type itemQuantity Flow message editor, Basic tab, right pane, Name field
      f) Click Advanced tab Flow message editor
      g) Click i_catalogOrder.sfmxsd > Messages > i_CatalogOrder > itemQuantity Flow message editor, Advanced tab
      h) Click The cell in the Type column to the right of itemQuantity
      i) Scroll the list and select (New Simple Type Restriction) The drop-down list that opens when you clicked the empty cell in the preceding step.
      j) Scroll the list and select xsd:short The Base Type drop-down list The New Simple Type Restriction window
      k) Click OK
      l) Click i_catalogOrder.sfmxsd > Messages > i_CatalogOrder > itemQuantity > xsd:short Flow message editor, Advanced tab
      m) Click Properties tab Flow message editor
      n) Click Logical properties > Value Constraints Flow message editor, Properties tab, left pane
      o) Type 0

      See CAUTION.

      Min field Flow message editor, Properties tab, the Inclusive Constraints group
      p) Type 999 Max field
      q) Click Basic tab Flow message editor
  5. Close the flow message editor.

Define the output message

The output message of the top-level flow contains the following message elements (variables):
  • The returnCode message element, used to contain a return code.
  • The returnMessage message element, used to contain a return message.
To define the output message:
  1. Create the output message file:
    Table 3. Create the output message file
    Action: Item: User interface:
    a) Right-click The CatalogSample.Interface folder EST Project Explorer
    b) Click New > Message Definition Popup menu
    c) Type a file name for the message file: o_CatalogOrder.sfmxsd New Message Definition wizard
    d) Click Finish
  2. Create the output message:
    Table 4. Create the output message
    Action: Item: User interface:
    a) Right-click o_catalogOrder.sfmxsd Flow message editor, Basic tab
    b) Click Add Message
    c) Click message1
    d) In the Properties group, in the Name field, type a new name for the message. o_CatalogOrder
  3. Add the first message element:
    Table 5. Create the message element returnCode
    Action: Item: User interface:
    a) Click Basic tab Flow message editor
    b) Right-click o_catalogOrder.sfmxsd > o_CatalogOrder Flow message editor, Basic tab, left pane
    c) Click Add Element
    d) Click localElement1
    e) Type returnCode Flow message editor, Basic tab, right pane, Name field
    f) Click Advanced tab Flow message editor
    g) Click o_catalogOrder.sfmxsd > Messages > o_CatalogOrder > returnCode Flow message editor, Advanced tab
    h) Click The cell in the Type column to the right of returnCode
    i) Scroll the list and select (New Simple Type Restriction) The drop-down list that opens when you clicked the empty cell in the preceding step.
    j) Scroll the list and select xsd:short The Base Type drop-down list The New Simple Type Restriction window
    k) Click OK
    l) Click o_catalogOrder.sfmxsd > Messages > o_CatalogOrder > returnCode > xsd:short Flow message editor, Advanced tab
    m) Click Properties tab Flow message editor
    n) Click Logical properties > Value Constraints Flow message editor, Properties tab, left pane
    o) Type 0

    See CAUTION.

    Min field Flow message editor, Properties tab, the Inclusive Constraints group
    p) Type 99 Max field
    q) Click Basic tab Flow message editor
  4. Add the second message element:
    Table 6. Create the message element returnMessage
    Action: Item: User interface:
    a) Click Basic tab Flow message editor
    b) Right-click o_catalogOrder.sfmxsd > o_CatalogOrder Flow message editor, Basic tab, left pane
    c) Click Add Element
    d) Click localElement1
    e) Type returnMessage Flow message editor, Basic tab, right pane, Name field
    f) Click Advanced tab Flow message editor
    g) Click o_catalogOrder.sfmxsd > Messages > o_CatalogOrder > returnMessage Flow message editor, Advanced tab
    h) Click The cell in the Type column to the right of returnMessage
    i) Scroll the list and select (New Simple Type Restriction) The drop-down list that opens when you clicked the empty cell in the preceding step.
    j) Scroll the list and select xsd:string The Base Type drop-down list The New Simple Type Restriction window
    k) Click OK
    l) Click o_catalogOrder.sfmxsd > Messages > o_CatalogOrder > returnMessage > xsd:string Flow message editor, Advanced tab
    m) Click Properties tab Flow message editor
    n) Click Logical properties > Value Constraints Flow message editor, Properties tab, left pane
    o) Leave blank Length field Flow message editor, Properties tab, the Length Constraints group
    p) Leave blank Min field
    o) Type 80

    See CAUTION.

    Max field
    q) Click Basic tab Flow message editor
  5. Close the flow message editor.

Define the variable message

The variable message of the top-level flow contains the following message elements (or variables):

As with the output message, the steps to define the variable message are very similar to the steps that you used to define the input message. Therefore, again, this subtopic presents the steps in a more streamlined fashion.

To define the variable message:
  1. Create the variable message file:
    Table 7. Create the variable message file
    Action: Item: User interface:
    a) Right-click The CatalogSample.Interface folder EST Project Explorer
    b) Click New > Message Definition Popup menu
    c) Type a file name for the message file: v_CatalogOrder.sfmxsd New Message Definition wizard
    d) Click Finish
  2. Create the variable message:
    Table 8. Create the variable message
    Action: Item: User interface:
    a) Right-click v_catalogOrder.sfmxsd Flow message editor, Basic tab
    b) Click Add Message
    c) Click message1
    d) In the Properties group, in the Name field, type a new name for the message. v_CatalogOrder
  3. To add the first message element:
    Table 9. Create the message element itemNumber
    Action: Item: User interface:
    a) Click Basic tab Flow message editor
    b) Right-click v_catalogOrder.sfmxsd > v_CatalogOrder Flow message editor, Basic tab, left pane
    c) Click Add Element
    d) Click localElement1
    e) Type itemNumber Flow message editor, Basic tab, right pane, Name field
    f) Click Advanced tab Flow message editor
    g) Click v_catalogOrder.sfmxsd > Messages > v_CatalogOrder > itemNumber Flow message editor, Advanced tab
    h) Click The cell in the Type column to the right of itemNumber
    i) Scroll the list and select (New Simple Type Restriction) The drop-down list that opens when you clicked the empty cell in the preceding step.
    j) Scroll the list and select xsd:short The Base Type drop-down list The New Simple Type Restriction window
    k) Click OK
    l) Click v_catalogOrder.sfmxsd > Messages > v_CatalogOrder > itemNumber > xsd:short Flow message editor, Advanced tab
    m) Click Properties tab Flow message editor
    n) Click Logical properties > Value Constraints Flow message editor, Properties tab, left pane
    o) Type 0

    See CAUTION.

    Min field Flow message editor, Properties tab, the Inclusive Constraints group
    p) Type 9999 Max field
    q) Click Basic tab Flow message editor
  4. To add the second message element:
    Table 10. Create the message element itemQuantity
    Action: Item: User interface:
    a) Click Basic tab Flow message editor
    b) Right-click v_catalogOrder.sfmxsd > v_CatalogOrder Flow message editor, Basic tab, left pane
    c) Click Add Element
    d) Click localElement1
    e) Type itemQuantity Flow message editor, Basic tab, right pane, Name field
    f) Click Advanced tab Flow message editor
    g) Click v_catalogOrder.sfmxsd > Messages > v_CatalogOrder > itemQuantity Flow message editor, Advanced tab
    h) Click The cell in the Type column to the right of itemQuantity
    i) Scroll the list and select (New Simple Type Restriction) The drop-down list that opens when you clicked the empty cell in the preceding step.
    j) Scroll the list and select xsd:short The Base Type drop-down list The New Simple Type Restriction window
    k) Click OK
    l) Click v_catalogOrder.sfmxsd > Messages > v_CatalogOrder > itemQuantity > xsd:short Flow message editor, Advanced tab
    m) Click Properties tab Flow message editor
    n) Click Logical properties > Value Constraints Flow message editor, Properties tab, left pane
    o) Type 0

    See CAUTION.

    Min field Flow message editor, Properties tab, the Inclusive Constraints group
    p) Type 999 Max field
    q) Click Basic tab Flow message editor
  5. Add the third message element:
    Table 11. Create the message element available
    Action: Item: User interface:
    a) Click Basic tab Flow message editor
    b) Right-click v_catalogOrder.sfmxsd > v_CatalogOrder Flow message editor, Basic tab, left pane
    c) Click Add Element
    d) Click localElement1
    e) Type available Flow message editor, Basic tab, right pane, Name field
    f) Click Advanced tab Flow message editor
    g) Click v_catalogOrder.sfmxsd > Messages > v_CatalogOrder > available Flow message editor, Advanced tab
    h) Click The cell in the Type column to the right of available
    i) Scroll the list and select (New Simple Type Restriction) The drop-down list that opens when you clicked the empty cell in the preceding step.
    j) Scroll the list and select xsd:string The Base Type drop-down list The New Simple Type Restriction window
    k) Click OK
    l) Click v_catalogOrder.sfmxsd > Messages > v_CatalogOrder > available > xsd:string Flow message editor, Advanced tab
    m) Click Properties tab Flow message editor
    n) Click Logical properties > Value Constraints Flow message editor, Properties tab, left pane
    o) Leave blank Length field Flow message editor, Properties tab, the Inclusive Constraints group
    p) Leave blank Min field
    o) Type 3

    See CAUTION.

    Max field
    q) Click Basic tab Flow message editor
  6. Close the flow message editor.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)