It's all about the answers!

Ask a question

How do I create a default value for a Boolean attribute?


Geoff Alexander (19623948) | asked Jan 31 '11, 4:54 p.m.
I'd like to specify a default value for a Boolean attribute. I looked at creating a Default Value Attribute Customization using Process Configuration -> Work Items -> Attribute Customization -> Default Values -> Add... on the Process Configuration tab . The problem is that there's no Boolean type in the Type drop-down on the Add Configuration dialog.

Also, is the default value for a Boolean attribute guaranteed to be false when I don't explicitly specify a default value?

I'm using RTC 3.0.

Thanks,
Geoff Alexander

2 answers



permanent link
Ralph Schoon (63.5k33646) | answered Feb 01 '11, 12:15 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Geoff,

I'd like to suggest to post this in the Using Team Concert forum. I quickly looked into it and couldn't find a solution either in the process customization UI.

Ralph


I'd like to specify a default value for a Boolean attribute. I looked at creating a Default Value Attribute Customization using Process Configuration -> Work Items -> Attribute Customization -> Default Values -> Add... on the Process Configuration tab . The problem is that there's no Boolean type in the Type drop-down on the Add Configuration dialog.

Also, is the default value for a Boolean attribute guaranteed to be false when I don't explicitly specify a default value?

I'm using RTC 3.0.

Thanks,
Geoff Alexander

Comments
Erwin Kunz commented Aug 09 '12, 10:44 a.m.

Hi Ralph Would your answer be the same with CLM2012

Thanks erwin


Erwin Kunz commented Aug 09 '12, 10:47 a.m. | edited Aug 09 '12, 10:51 a.m.

Sorry Ralph, I just found out that this is now possible with the Eclipse for 4.0 Thanks erwin


permanent link
diego santos (3611) | answered Mar 21 '11, 8:53 a.m.
Guys,

Was needing to assign a default value for a field of type booelan today could do so through the following procedure:

Steps:

1. Create a java script as below:

dojo.provide ("com.example.common.DefaultBooleanTrue");
(function () {
dojo.declare (com.example.common.DefaultBooleanTrue ", null, {
getValue: function (attribute, WorkItem configuration) {
return true;
}
__sentinel: null
});
})();

I used the article: Customizing attributes, as I am not the programmer code was not that great but it worked ;-)

2. Additions to the script in the project as described in the article: Customizing attributes

3. In the Process xml I pasted the following snippet:
<valueProviders>
<valueProvider id="DefaultBooleanTrue" name="Default Booelan True" providerId="com.ibm.team.workitem.shared.common.internal.valueProviders.ScriptAttributeValueProvider">
<script class="com.example.common.DefaultBooleanTrue"/>
</valueProvider>
</valueProviders>

4. In the configuration process: Types and Attributes, select the attribute and assign the "DefaultBooelanTrue" as a value calculated from the field.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.