It's all about the answers!

Ask a question

Enumeration List and Unassigned Literal


Sian O'Briain (351021) | asked Apr 08 '16, 7:46 a.m.
I currently have a precondition to require an attribute for a certain condition. This attribute is of type 'enumeration list'. Even though I have set a value in the enumeration for this attribute as the 'unassigned literal', it is still allowed to be set . Default literal doesn't seem to be used for 'enumeration list'

Any ideas on how I can stop the unassigned literal from being a valid option?

Accepted answer


permanent link
Sian O'Briain (351021) | answered Apr 08 '16, 9:37 a.m.
Thanks - my workaround was to archive the literal that we used for "default" and "unassigned" since when using an enumeration list these identities seem to do nothing
Ralph Schoon selected this answer as the correct answer

Comments
Ralph Schoon commented Apr 08 '16, 9:39 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Which avoids the fuzziness of the definition "required".

2 other answers



permanent link
Ralph Schoon (63.5k33646) | answered Apr 08 '16, 8:45 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
What kind of precondition is that? A JavaScript condition? A Server side Plugin?

What version of RTC?

Dependent on what you have, I would check what information an enumeration list attribute returns a list of enumeration literals so you can't test against "unassigned" you will have to test if the list is empty, if not you will have to check on multiple values. I assume your condition is not designed to handle enumeration lists and you will have to think about what "required" means in this context.

If this is JavaScript based, there might be a problem to actually access the enumeration list attribute. I had issues with list attribute values, as far as I can remember.

Comments
Sian O'Briain commented Apr 08 '16, 9:16 a.m.

Hi Ralph,

I have a simple javascript condition that checks if another attribute is blank. If this attribute is set then I want my enumeration list attribute to be mandatory. Unfortunately mandatory means users can still select the value that we have assigned to be the "Unassigned literal" (None) in this case.

This method works fine for regular single select enumeration (single select) attributes.

Version is 5.0.2


Ralph Schoon commented Apr 08 '16, 9:25 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

So what checks for mandatory and what does that mean in case of an enumeration list? If it is the required for condition precondition that ships with RTC, I would assume that - if it works at all for list attributes - that it checks for a literal has to be available, The "Unassigned literal" is a literal.

You might consider this a bug, if so approach support with a PMR, On the other hand, as I mention, what "required" means for a list type attribute is something completely different from a not list type attribute. You can argue about what should or should not be available for selection and how the condition should work, there might be good reasons for multiple different approaches.


Sian O'Briain commented Apr 08 '16, 9:38 a.m.

i.e. for an enumeration list, default is blank. For type enumeration default is the default literal.


permanent link
Matt Muller (59813674) | answered Apr 15 '16, 6:37 a.m.

(sorry late to Contribute to this one)

Do you have to have Operational Behaviours - Attribute Validation on?


Comments
Sian O'Briain commented Apr 15 '16, 6:51 a.m.

I was using "required attributes for condition" only but I was advised that it is good practice to always have "Attribute Validation" as a precondition also

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.