cancel
Showing results for 
Search instead for 
Did you mean: 

enum dynamic property values

kethur
Champ in-the-making
Champ in-the-making
Hi all,

I have a situation where i need to populate the activiti:value dynamically. Is there a way I can generage the <activiti:value tags dymically based on an API call?

Please note that the generating the XML dynamically will not work for me because, the list values will be changing based on the user roles/permissions.
         
<activiti:formProperty id="entityFindList_listbox_4" type="enum">
              <activiti:value id="left" name="Go Left" />
              <activiti:value id="right" name="Go Right" />
              <activiti:value id="up" name="Go Up" />
              <activiti:value id="down" name="Go Down" />
          </activiti:formProperty>



I am looking for something similar to this below:

<activiti:formProperty id="entityFindList_listbox_4" type="enum" enumValues ="${serviceObj.getValues()}">


Thanks,
Raj
2 REPLIES 2

kethur
Champ in-the-making
Champ in-the-making
I found the below userFormType configuration which is very useful and it works. 

in spring context xml:
              <property name="customFormTypes">
          <list>
            <ref bean="dynamicEnum"/>
          </list>
        </property>

    <!–  Custom form types –>
    <bean id="dynamicEnum" class="com.xxxx.xxxx.xxxxworkflow.business.impl.DynamicEnumFormType"/>
     


DynamicEnumFormType is a class which is extending AbstractFormType


Is this the way to go?

Raj

jbarrez
Star Contributor
Star Contributor
Yes, this looks good. Does it work?