cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping of enum form properties

kaech
Champ in-the-making
Champ in-the-making
Hi,

when mapping a Java enum to an enum form property I get the exception:

Invalid value for enum form property: Part1

I am using this mapping inside a UserTask:

<activiti:formProperty id="theparts" expression="#{order.part.value()}" type="enum">
            <activiti:value id="Part1" name="Part1" />
            <activiti:value id="Part2" name="Part2" />
            <activiti:value id="Part3" name="Part3" />
</activiti:formProperty>

order is a JavaBean the part property is a Java enum which contains the members Part1, Part2 and Part3.
What am I doing wrong?
1 REPLY 1

frederikherema1
Star Contributor
Star Contributor
A form-property of type enum isn't actually mapping to a model-value of an "Enum", it's just an enumeration of possible string-values. So I guess the solution would be to write your own form-property-type which can handle enums or create a getter/setter on your order-bean which gets/sets the string-representation of the enum.