Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

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

0 votes



2 answers

Permanent link
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

0 votes

Comments

Hi Ralph Would your answer be the same with CLM2012

Thanks erwin

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


Permanent link
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.

0 votes

Your answer

Register or log in 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.

Search context
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
Question details
× 10,938

Question asked: Jan 31 '11, 4:54 p.m.

Question was seen: 8,381 times

Last updated: Aug 09 '12, 10:51 a.m.

Confirmation Cancel Confirm