The Choice object evaluates the contents of a document or a variable, and routes the document accordingly, similar to the switch/case construct of other programming languages. The main difference is that the document can match multiple cases simultaneously.

Note: The Choice object is a direct replacement for the Decision Switch object, which was available in iWay 7.0.x releases.
The Choice object is located in the iWay Integration Tools (iIT) Palette, under the Flow Control group, as shown in the following image.

Choice Object in Flow Control

When you add the Choice object to your process flow using iIT, configuration properties for this object are available in the Properties tab and grouped by subtabs.

Expression subtab:

Choice Expression Subtab

The Choice object can direct the document down one or more alternate paths, based on the value of the switch expression. In the following example, the document contains a value indicating the protocol(s) through which it should be routed (FILE, EMAIL, HTTP). To accomplish this, an XPath is constructed to capture the switch value from the document. You can also switch on computed conditions by using a variable that was set to one of your case values earlier in the process flow.

Cases subtab:

Choice Cases Subtab

Add the Choice case values and descriptions to the table. Each choice case creates a named outlet leaving the Choice node. When the current switch value is equal to a given case, the document will be sent down the corresponding edge for further processing. If the expression recovers multiple switch values, the document will be sent down multiple edges simultaneously. 

In the example below, three cases have been added for sending the document down the FILE, EMAIL, or HTTP path line of the process flow for execution, based on the conditional value returned by the expression.

Choice Cases Path Line

Note that when you will be wiring the edges from the Choice node, you will also have the option to set the standard system edges. You should always ensure that you set the Default edge, in case the expression does not return the expected value.

For illustration purposes, the process flow with a Choice node, three customized edges, and a default edge may look similar to the following image.

Choice Process Flow

Debug subtab:

Choice Debug Subtab

The Debug subtab allows you to configure iterative tracing limits. When this object is part of an iterative loop, the maximum number of iterations that can be captured is 20. Tracing can be controlled by specifying the iteration that begins and ends the document capture.

Specify the iterations in which you want the tracing to begin and end.

The following tracing formats are available from the drop-down list:

  • Standard tracing (default)
  • Standard tracing displayed in hex format
  • Just the output document
  • None, under any circumstances