I am running Java code to prepopulate a parameter's choices.

However, if there are x choices, I want to hide the parameter completely and not prompt for it.

How do I reference the count on the parameter? Can I do something like parameter(myParam).length?

thx

asked 21 Mar '12, 11:15

wildcatz's gravatar image

wildcatz
16141417
accept rate: 0%


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.

link

answered 22 Mar '12, 05:23

wojciechka's gravatar image

wojciechka ♦♦
7.8k61122
accept rate: 26%

thanks - that's exactly what I was looking for!

(22 Mar '12, 20:47) wildcatz
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×3
×1

Asked: 21 Mar '12, 11:15

Seen: 845 times

Last updated: 22 Mar '12, 20:47