uCosminexus Service Platform, Basic Development Guide

[Contents][Glossary][Index][Back][Next]

6.5.17 Outputting Different Values According to Conditions

Specifies a condition and outputs different values depending on whether the condition is satisfied.

Organization of this subsection
(1) Function used
(2) Setup procedure

(1) Function used

To specify a condition and output different values depending on whether the condition is satisfied, you use the choose node function. The following figure shows an example that uses the choose node function.

Figure 6-18 Usage example of the choose node function

[Figure]

(2) Setup procedure

To specify a condition and output different values depending on whether the condition is satisfied:

  1. From the palette, choose the choose node function (choose), and deploy it in the mapping viewer.
  2. Set up a mapping line.
    To set up a mapping line by specifying a mapping source in the Choose Node dialog box, instead of using the palette tool, execute Steps 7 through 11.
  3. Use one of the following methods to open the Choose Node dialog box.
    • Right--click the choose node function, and choose Setting.
    • Double--click the choose node function.
    The Choose Node dialog box opens.
    If you specified a mapping line in step 2, a mapping source is specified in Output of Condition & output value.
    For details about the Choose Node dialog box, see the manual Cosminexus Service Platform Overview.
  4. Use one of the following methods to open the Add/Edit Condition dialog box.
    • When a mapping source is specified in Output of Condition & output value
      Choose the mapping source specified in Output of Condition & output value, and click Edit.
    • When a mapping source is not specified in Output of Condition & output value
      Click Add.
    For details about the Add/Edit Condition dialog box, see the manual Cosminexus Service Platform Overview.
  5. Click Set Condition.
    The Condition Settings dialog box opens.
  6. Specify a condition.
    For details about how to set up the condition in the Condition Settings dialog box, see the manual Cosminexus Service Platform Reference.
  7. Specify the following in the When condition is true column:
    • To output the transformation-destination node
      Choose the Output the node check box.
    • To not output the transformation-destination node
      Choose the Do not output the node check box.
    If the mapping source has already been specified in Output of Condition & output value, the mapping source is displayed in Value. If you do not wish to change the mapping source, proceed to step 10.
  8. If the Output the node check box was selected in step 7, specify the following in the Output value column:
    • To output a value to the transformation-destination node
      Choose the Output the node check box.
    • To not output a value to the transformation-destination node
      Choose the Empty check box.
  9. If the Output the node check box was selected in step 8, specify the following for Value:
    • To output the value of the transformation-source node
      Clicking Choose Node opens the Choose Node dialog box. In the Choose Node dialog box, choose the transformation-source node whose value is to be output.
    • To output the value of the function
      Clicking Choose Function opens the Choose Function dialog box. In the Choose Function dialog box, choose the function whose value is to be output.
  10. When a transformation-source node is specified in Value, to specify a condition for the transformation-source node and map it only when this condition is satisfied, click Set Node Condition.
    The Set Node Condition dialog box opens.
    For details about how to set a node condition, see 6.7 Specifying Node Conditions. For details about the Set Node Condition dialog box, see the manual Cosminexus Service Platform Reference.
  11. Click OK.
    The Add/Edit Condition dialog box closes.
  12. To add or edit a condition, repeat steps 4 through 11.
    If you specify multiple conditions and mapping sources in Condition & output value, condition evaluation is sequentially performed, starting with the condition displayed at the top.
  13. In the When no condition matches column of the Choose Node dialog box, specify the mapping source that is to be used when none of the conditions are satisfied.
    The setting method is the same as that used for the When condition is true column of the Add/Edit Condition dialog box.
  14. Click OK.
    If you specify a function or a transformation-source node that is not for the mapping source inside the condition specified in the Choose Node dialog box, a mapping line [Figure] (condition line) is set up between the transformation-source node or function inside that condition and the choose node function.
    Note
    • When mapping a value to a transformation-destination node of complex content, do not choose Output the value and specify Value. When mapping a value to a transformation-destination node that is not of complex content, you must specify Value if you choose Output the value.
    • When mapping a value to a choice element all of whose child elements' minimum occurrence count is set to 1 or greater, do not specify Empty.
    • When mapping a value to an element (other than a choice element) that has a child element whose minimum occurrence count is set to 1 or greater, do not specify Empty.
    • When mapping a value to a node whose occurrence count is set to 1 or greater, do not specify Do not output the node.
    • If you specify even a single loop node function for an output value, specify the loop node function for all other output values. If you specify an item other than a loop node function for an output value, specify an item other than a loop node function for all other output values.