IfThenElse

Package: 
Version: 
1
Is Abstract: 
no
Is Pattern: 
no
Definition: 

IfThenElse describes an if-then-else decision type of control construct. If the stated condition is met, then the associated Workflow Sequence in containsSubSeqence is triggered, otherwise the Workflow Sequence that is triggered is the one associated via elseContains.

Explanatory Notes: 

Contains a condition and two associations:
- one to the Workflow Sequence that is triggered when the condition is true (containsSubSequence), and
- another to the Workflow Sequence that is triggered when the condition is false (elseContains).

Example: 
An IfThenElse object describes the conditional logic in the flow of a questionnaire or other data collection instrument, where if a stated condition is met, one path is followed through the flow, and if the stated condition is met, another path is taken.
Property: 
NameCardinalityDatatypeDescription
elseIf
0..n
The condition to check if the IfThenElse condition is false.
Relationship: 
NameTarget ObjectDescriptionSource cardinalityTarget cardinalityRelationship type
elseContains
Optional sequence of Process Steps that are triggered when the condition is false.
0..n
0..1
Aggregation

Stage:

DDI 3.2: 
d:IfThenElseType
Is extendable: 
Is property: 
0
RDF Mapping: 

Comments

Should it be possible to have multiple elseif conditions?

Is the else condition required or is it valid to have only a if condition?

hasElseIf currently points to IfThenElse, which is not consistent with DDI 3.2. In 3.2 it pointed to 0-n IfThen (without an else). While XML keeps the order of IfThen this might be a problem for other data models without an explicit order. Take the following example:

IF x > 10
THEN y1
ELSEIF
..IF x > 5
..THEN y2
ELSEIF
..IF x > 0
..THEN y3
ELSE y4

Options that have been discussed:
- just ignore it: it's the users problem that the example above produces errors
- remove the elseif (you can still nest IfThenElse in else)
- store the order of elseif statements

The IfThenElse has been restructured as per discussions with Jay. There is a single class now, IfThenElse, that has two relationships: "contains", to a set of Process Steps that are triggered when the condition is true, and "containsElse", to a set of Process Steps that are triggered when the condition is false.