cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Enum Form Property

ykphuah
Champ in-the-making
Champ in-the-making
I want to have a enum list that is dynamically populated, I have searched the forum and saw this example:

http://www.jorambarrez.be/blog/2013/03/13/creating-a-new-form-property-in-activiti/

What I want is a slightly more advanced, I am not using the activity-explorer, but I want to use the activiti-designer eclipse plugin.

So for example, if I want to populate the list of users, based on a "user group" that I will be able to pass in in the activiti designer plugin. Is this possible?

I saw the "Form property configuration" of the activiti-designer have a few parameters like express, variable, but I can't seem to get this from the FormProperty object when I want to render it on my own.

I tried to use back the "Form values", and base my base class on EnumFormType, but this can't work as well because EnumFormType is expecting the list to be passed in the constructor, while my class is created by Spring with an empty constructor.
2 REPLIES 2

jbarrez
Star Contributor
Star Contributor
If you're not using Activiti Explorer, wouldn't it be easier to use the formKey approach and not the formProperties. That way, you can do whatever you want.

ykphuah
Champ in-the-making
Champ in-the-making
I still want the flexibility of the form designer in the activity-designer though. So my app will be slightly replicating the activiti-explorer when it comes to form rendering.

Found a way to do this, set a variable in a ScriptTask, e.g "userGroupList=admin", right before the User Task, then in the User Task's form, just set the type to String, with the name = "userGroup", when the renderer see this special name, it will use a drop down list instead of a standard input field. This will work well with testing the workflow in the activiti-explorer during development as well!