-
Notifications
You must be signed in to change notification settings - Fork 0
Type Choice
The Type Choice is a Control Structure that can be used in the Xyna Process Modeller while modeling a Workflow.
With Type Choices you have the possibility to perform a specific action depending on the presence of a specific Data Type. For each derived Data Type a different course of action can be taken.
To insert a Type Choice, drag the Type Choice symbol from the icon bar into the Workflow. Then drag a Data or Exception Type onto the Anytype Variable. One lane will automatically be created for each inheriting Data or Exception Type, as well as the Base type.
Please note: At runtime, the lane with the most specific Data Type matching the input is chosen. If there is no matching lane, the process will be terminated with a runtime exception.
You can either model Process Steps inside a lane or remove the lane, if it is not necessary. To remove a lane, select it (blue selection outline) and press <kbd>Del</kbd>.
If there is a new Type inheriting from one used as a Base Type for a Type Choice, it won't be automatically extended by a new lane for the new inheriting Type. The new lane has to be manually inserted by clicking the + button in the input area of the Type Choice to Complete Sub-Types.
To provide the same action for different inheriting Types, one can unite lanes by dragging the label of a lane (by using the drag indicator) onto the label of another lane. To separate united lanes, click the Detach button on the left side of the label of the lane to be separated.
A Type Choice detects the possible Output Parameters automatically, if the decision is unambiguous. If there is an Output Parameter of a specific Data Type available on every lane, this parameter will be used as an Output Parameter of the Type Choice. If a lane ends with a Throw step, it is excluded from the mechanism determining the Output Paramter of the Type Choice. If there is more than one output of that specific Data Type on a lane, the last one is chosen.
Please note: There is no way to manually select the source of the Type Choice's Output Parameter. To circumvent this issue, Conditional Branching can be used instead provides a special mode to solve ambiguities lane by lane.
If there is a Data Type WLAN Device 10x and another Data Type WLAN Device 250e, both inheriting from Data Type Device Type, you can insert a Type Choice on Device Type (fig. 1).