Notes on Dependencies

  • If action=hide for a Target element, the element is hidden. If action=show, the element is enabled and contributes to the SAS code that is generated by the Velocity script.
  • Not all dependencies are evaluated each time the Velocity script runs and produces the SAS code. When the task is first opened, all dependencies are run to establish initial values. After that, only dependencies that are linked to the current interaction in the user interface are evaluated. The value of the condition attribute determines whether a dependency is evaluated. All UI elements have a name in the Options element (in the metadata section of the common task model). When a user selects a UI element, the name of the UI element is checked against each dependency. Only conditions that contain the name of the UI element are evaluated, and all valid actions are performed.
  • Dependencies can have cascading effects.
    • Dependencies that are order dependent cannot be written in a circular manner.
    • Dependencies are evaluated in top-down order. An option is order independent if the option name appears only in the condition attribute of the Target element. An option is order dependent if the option name appears in the condition and option attributes of the Target element.
This example shows a correct and incorrect ordering of dependencies:
<UI>
   <Container option="options">
      <Group option="basic options">
         <Option name="COMBOBOX"/>
         <Option name="ITEM1"/>
         <Option name="ITEM2"/>
         <Option name="ITEM3"/>
            <OptionItem option="CHECKBOX"/>
            <OptionItem option="INPUTTEXT"/>
      </Group>
   </Container>
</UI>

<Dependencies>
1<!-- Correct ordering of the dependencies -->
   <Dependency condition="$COMBOBOX=='ITEM1'">
      <Target conditionResult="true" option="CHECKBOX" action="set"
         property="value" value="1"/>
   </Dependency>
   <Dependency condition="$CHECKBOX=='1'">
      <Target conditionResult="true" option="INPUTTEXT" action="enable"/>
      <Target conditionResult="false" option="INPUTTEXT" action="disable"/>
   </Dependency>

2<!-- Incorrect ordering to the dependencies -->
   <Dependency condition="$CHECKBOX=='1'">
      <Target conditionResult="true" option="INPUTTEXT" action="enable"/>
      <Target conditionResult="false" option="INPUTTEXT" action="disable"/>
   </Dependency>
   <Dependency condition="$COMBOBOX=='ITEM1'">
      <Target conditionResult="true" option="CHECKBOX" action="set"
         property="value" value="1"/>
   </Dependency>
</Dependencies>
1 This first dependency is order independent. COMBOBOX is a name that is used in the condition, but the value of COMBOBOX is not a target in any of the other dependencies.
2 The second dependency is order dependent. CHECKBOX is used in the condition, and the value of CHECKBOX is also a target for option=”CHECKBOX” in the preceding Dependency element. In this case, the state for INPUTTEXT is not evaluated properly because condition=”$CHECKBOX=='1'" is evaluated before condition=”$COMBOBOX=='ITEM1'".