cancel
Showing results for 
Search instead for 
Did you mean: 

random order in enum fields

halina9000
Champ in-the-making
Champ in-the-making
Hello,
next one newbie on a board Smiley Happy

The problem is:
I have enum field definition

<activiti:formProperty id="myTask" name="My task" type="enum" required="true">
          <activiti:value id="1" name="1"></activiti:value>
          <activiti:value id="2" name="2"></activiti:value>
          <activiti:value id="3" name="3"></activiti:value>
          <activiti:value id="4" name="4"></activiti:value>
        </activiti:formProperty>

and then Activiti Explorer shows form with this order:
3
2
1
4

Anybody want to explain me (warning: newbie!) what am I doing wrong?

regards
7 REPLIES 7

trademak
Star Contributor
Star Contributor
Hi,

And is that always the case? Then it's probably a bug.
Could you raise a JIRA?

Best regards,

halina9000
Champ in-the-making
Champ in-the-making

trademak
Star Contributor
Star Contributor
Hi,

The enum id and name values are stored with a Map inside the Activiti Engine.
Therefore the order of the enum values can not be restored.

Best regards,

halina9000
Champ in-the-making
Champ in-the-making
Hi,

it is not good news…

I often have multiple items (>20) in enum fields. And random order makes it almost unusable.

Could you suggest any temporary solution or workaround? Maybe alphabetical order at least?

regards
Tom

trademak
Star Contributor
Star Contributor
Okay I understand. Are you using the Activiti Explorer for this?
Then I would advise to create a new form field component that does this sorting for you.
I can help you with this when that's needed.

Best regards,

nitroin
Champ in-the-making
Champ in-the-making
Are there any reference or guideline in the creation of this kind of component?

Thanks in advice.

trademak
Star Contributor
Star Contributor
Hi,

The Activiti Explorer contains a couple of Form types that you can use as a reference.
I also written a section about it in my Activiti in Action book.

Best regards,