How to reference number of choices in a parameter?

Comments

1 comment

  • Avatar
    wojciechka

    It is not possible to access <choiceParameter> values. However, if you are using stdout from an application, you can check the number of entries it will generate and then set parameter(myParam).show accordingly.

    You can use the XML from Regular expression - count lines in stdout question to get the number of lines or use a regular expression to check if it contains at least the specified number of newlines.

    For example:

    <setInstallerVariable>
       <name>parameter(myParam).show</name>
       <value>0</value>
       <ruleList>
          <regExMatch>
            <logic>matches</logic>
            <pattern>(.*\n){10}</pattern>
            <text>${program_stdout}</text>
          </regExMatch>
       </ruleList>
    </setInstallerVariable>
    

    The above will check that the text contains at least 10 newline characters.

Please sign in to leave a comment.