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

RTC workitem making boolean attributes mandatory

 Hi All,


I need to make boolean tye attribute as a required feild in RTC for a particular state. I know there is a precondition(Operation behavior) available however in that there we don't get the attributes with type as boolean.

I have a customized workitem and a attribute which is kind of checkbox, I need to make the checkbox mandatory for a particular state.

Thanks
Kunal.

0 votes


Accepted answer

Permanent link

I suppose that the problem with making checkboxes mandatory is that they have always a value, i.e. "false" when they are not checked and "true" when they are.

You'd better define a different attribute, or write a precondition on WorkItemSave that reads the value of the attribute and returns an error if it is "false".

Kunal N selected this answer as the correct answer

1 vote

Comments

 Thanks for your response Luca.


What if I use a radio button instead of a checkbox with two options. I need to find a way to achieve this without writing a precondition altogether.

Thanks
Kunal

 The presentation does not make a difference. A boolean value is always set and there is no unassigned. So mandatory does not make any sense for boolean attributes. 


Also writing a custom extension will not help as it also can not detect if the attribute was manually set.
 
Lucas and Donalds suggestions to use a different attribute that can be unassigned and has two values resembling true and false is the only viable solution here.

Use an enumeration attribute, maybe with just the "true" value.
This way, if the attribute is "unassigned" the mandatory condition will raise a validation error.
By explicitly setting it to "true", the condition will no longer raise any error.

 Hello Luca,


As suggested by you, if we use a enum attribute with only true and unassigned value how can i achieve following:

Suppose I setup enumeration with values as true and assigned then I need to set a condition such that whenever the workitem is in a state "X" it should move to state "Y" only if the enumeration value is selected as "True " by the user.

Thanks
Kunal N

Kunal,
when you define the enumeration for such an attribute, specify that the Unassigned" (or whatever string you like) value is set as both the Default Literal and the Unassigned Literal.
Then, you must set the attribute as mandatory in state "Y".
If the user who is moving the work item from X to Y has not set the attribute value to "True" the mandatory attributes precondition will raise a validation error.

1 vote

 Thanks for your help Luca

showing 5 of 6 show 1 more comments

One other answer

Permanent link

An alternative is use an enumeration with values "true" and "false". When you don't pick either value, the attribute is "unassigned".

1 vote

Comments

 Hi Donald,


If I go by the way you are suggesting, then How can I achieve following scenario:

Suppose I setup enumeration with values as true, false and assigned then I need to set a condition such that whenever the workitem is in a state "X" it should move to state "Y" only if the enumeration value is selected as "True " by the user.

Thanks
Kunal N

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
× 7,497

Question asked: Oct 03 '17, 7:54 a.m.

Question was seen: 3,471 times

Last updated: Oct 06 '17, 10:16 a.m.

Confirmation Cancel Confirm