<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
                         "http://docbook.org/xml/4.4/docbookx.dtd">
<chapter>
    <title>Switch Component Usage</title>
    <sect1>
        <title>Synopsis</title>
        <para>The Switch component forwards an input value to one of two outputs.</para>
    </sect1>
    <sect1>
        <title>Rationale</title>
        <para>The Switch component allows to direct the data flow within a workflow. It receives
            input values at one pre-defined input and forwards them to one of two pre-defined
            outputs. To which one the values are forwarded depends on a condition. The condition is
            configured by the user within the Switch component. It can be based on the values
            received at the pre-defined input or on values received at additional inputs.</para>
    </sect1>
    <sect1>
        <title>Usage</title>
        <para>The Switch component has a pre-defined input 'To forward'. Values, which are received
            at that input are forwarded to one of the two outputs. That input is a so-called 'data
            input'. The default data type of the data input is float. Change the data type to the
            one you require to forward. Besides that input, you can create as many inputs as you
            like. They are intended to be used within the condition definition and are so-called
            'condition inputs'. Note: If you like to direct data of multiple inputs you need to add
            multiple Switch components to your workflow.</para>
        <para><inlinegraphic fileref="../../images/image001.png"/></para>
        <para>Define your condition within the 'Condition' tab. A condition may contain input names,
            numbers, relational operators, and parenthesis. You can either insert input names and
            valid operators from the drop down list on the right-hand side or you can write them by
            yourself. Inputs can only be used within conditions if their data type is either
            integer, float or boolean. The data input automatically appears in the drop down list,
            if it is of an allowed data type.</para>
        <para><inlinegraphic fileref="../../images/image002.png"/></para>
        <para>There are three options available that define the behavior of the Switch component within loops.
        In the 'Loop Control' tab you can choose between:
        <itemizedlist>
                    <listitem>
                        <para>Never close outputs: Use this option if the switch component is used outside of a loop or if it is not supposed to control the loop.</para>
                    </listitem>
                    <listitem>
                        <para>Close outputs on 'True': Use this option if the switch component is
                        supposed to control the loop. All inputs which are connected to the output
                        'True' will be closed. Note that a component is finished if all of its
                        inputs are closed.</para>
                    </listitem>
                    <listitem>
                        <para>Close outputs on 'True': Use this option if the switch component is
                        supposed to control the loop. All inputs which are connected to the output
                        'False' will be closed. Note that a component is finished if all of its
                        inputs are closed.</para>
                    </listitem>
                </itemizedlist>
        </para>
    </sect1>
</chapter>
