Issues with parameter validationActionList in unattended mode

Comments

2 comments

  • Avatar
    laxmireddy

    Reformatting the snippets in code sample:

        <choiceParameter>
            <name>DATABASE_TYPE</name>
            <title>Choose a database</title>
            <description></description>
            <explanation>Select database</explanation>
            <value></value>
            <default></default>
            <allowEmptyValue>0</allowEmptyValue>
            <cliOptionName>${project.shortName}_database</cliOptionName>
            <displayType>radiobuttons</displayType>
            <ordering>default</ordering>
            <width>40</width>
            <optionList>
                <option>
                    <description></description>
                    <image></image>
                    <text>MSS</text>
                    <value>MSS</value>
                </option>
                <option>
                    <description></description>
                    <image></image>
                    <text>Oracle</text>
                    <value>ORA</value>
                </option>
            </optionList>
            <validationActionList>
                <setInstallerVariable name="DBMS_DRIVER_CLASS_NAME" value="net.sourceforge.jtds.jdbc.Driver">
                    <ruleList>
                        <compareText>
                            <logic>equals</logic>
                            <text>${DATABASE_TYPE}</text>
                            <value>MSS</value>
                        </compareText>
                    </ruleList>
                </setInstallerVariable>
                <setInstallerVariable name="DBMS_DRIVER_CLASS_NAME" value="oracle.jdbc.driver.OracleDriver">
                    <ruleList>
                        <compareText>
                            <logic>equals</logic>
                            <text>${DATABASE_TYPE}</text>
                            <value>ORA</value>
                        </compareText>
                    </ruleList>
                </setInstallerVariable>
            </validationActionList>
        </choiceParameter>
    
        <parameterGroup>
            <name>CheckDatabaseConnectivity</name>
            <title>Check Database Connectivity</title>
            <explanation></explanation>
            <value></value>
            <default></default>
            <parameterList>
                <booleanParameter>
                    <name>chk_database</name>
                    <description>Check if you want to verify database connectivity</description>
                    <explanation></explanation>
                    <value>1</value>
                    <default></default>
                    <displayStyle>checkbox-left</displayStyle>
                </booleanParameter>
            </parameterList>
            <validationActionList>
                <runProgram>
                    <program>${java_exe}</program>
                    <programArguments> -cp <Classpath-with-db-jars>  com.acme.DatabaseConnectionAction  ${LOGID} ${LOGPASSWORD}  ${DATABASE_URL} ${DBMS_DRIVER_CLASS_NAME} </programArguments>
                </runProgram>
            </validationActionList>
        </parameterGroup>
    
  • Avatar
    wojciechka

    The parameter validations are not run in unattended mode. This is the reason for not detecting it.

    What you should do is also run the same checks in <readyToInstallActionList> to double-check the parameter values - for example:

    <readyToInstallActionList> <if> <actionList> <setInstallerVariable name="DBMS_DRIVER_CLASS_NAME" value="net.sourceforge.jtds.jdbc.Driver"> <ruleList> <compareText> <logic>equals</logic> <text>${DATABASE_TYPE}</text> <value>MSS</value> </compareText> </ruleList> </setInstallerVariable> <setInstallerVariable name="DBMS_DRIVER_CLASS_NAME" value="oracle.jdbc.driver.OracleDriver"> <ruleList> <compareText> <logic>equals</logic> <text>${DATABASE_TYPE}</text> <value>ORA</value> </compareText> </ruleList> </setInstallerVariable> <runProgram> <program>${java_exe}</program> <programArguments> -cp (Classpath-with-db-jars&gt;) com.acme.DatabaseConnectionAction ${LOGID} ${LOGPASSWORD} ${DATABASE_URL} ${DBMS_DRIVER_CLASS_NAME} </programArguments> </runProgram> </actionList> <conditionRuleList> <compareValues> <logic>does_not_equal</logic> <value1>${installer_interactivity}</value1> <value2>normal</value2> </compareValues> </conditionRuleList> </if> </readyToInstallActionList>

Please sign in to leave a comment.