specifying attributes in command line options avail yet?

0 views
Skip to first unread message

Charles Scott

unread,
Aug 18, 2007, 3:17:33 PM8/18/07
to contr...@googlegroups.com
Is it now possible to define entity.attribute.* like properties in
command line options?

For example, this workflow would like to use such a property:

<command name="MyCommand" description="wants to use
attributes in opts" command-type="WorkflowCommand">
<opts>
<opt parameter="myParam" required="false" type="string"
default="${entity.attribute.my_attribute}" property="opts.myParam"
description="wants to use attributes in optsr"/>
</opts>
</command>

Is there an example somewhere where I can look at if it is now
possible in 3.1beta?

I recall it might be in reference to use of a "named" property.

Thanks.

Alex-SF

unread,
Aug 18, 2007, 5:51:41 PM8/18/07
to ControlTier
The get-opts task now supports a new attribute called
"defaultproperty" that lets you specify a property name to use as the
default.

First example shows the simple usage.


<get-opts optsValue="" usageProperty="usage"
errorProperty="error">
<opts>
<opt parameter="arg3" type="string"
property="opts.arg3"
required="true" defaultproperty="default.arg2" />
</opts>
</get-opts>

Second example shows one specifying a non existent property in the
defaultproperty attribute. Since it is not defined, the "default"
value is used. That is the precedence rule.

<get-opts optsValue="" usageProperty="usage"
errorProperty="error">
<opts>
<opt parameter="arg4" type="string"
property="opts.arg4"
required="true" defaultproperty="doesnotexist"
default="3"/>
</opts>
</get-opts>

If the "required" attribute is set true, and a default can not be set
AND the user does not provide the argument, then get-opts will throw a
ParseOptsException.

Charles Scott

unread,
Aug 18, 2007, 5:54:28 PM8/18/07
to contr...@googlegroups.com
thanks for the response, just got it to work a moment ago.
Reply all
Reply to author
Forward
0 new messages