cancel
Showing results for 
Search instead for 
Did you mean: 

Support for list types in form properties?

oconnor0
Champ in-the-making
Champ in-the-making
I have a situation where I want to call a bunch of subprocesses. I want to be able to configure the possible & actual subprocesses via some data-driven method. My initial thinking was to do this via a list form property where each value is from a data-driven enum. It doesn't appear that Activiti supports list form properties.

Is there a way to handle list form properties?
Is there a better way to solve what I'm trying to do?

Thanks.
6 REPLIES 6

frederikherema1
Star Contributor
Star Contributor
Activiti has an "enum" type, which allows you to select from a predefined list of values:

(extract from user guide)
<activiti:formProperty id="vacationApproved" name="Do you approve this vacation" type="enum" required="true">
          <activiti:value id="true" name="Approve" />
          <activiti:value id="false" name="Reject" />
        </activiti:formProperty>

oconnor0
Champ in-the-making
Champ in-the-making
Activiti has an "enum" type, which allows you to select from a predefined list of values:

(extract from user guide)
<activiti:formProperty id="vacationApproved" name="Do you approve this vacation" type="enum" required="true">
          <activiti:value id="true" name="Approve" />
          <activiti:value id="false" name="Reject" />
        </activiti:formProperty>
I am aware of the enum type. What I was trying to ask was for something somewhat different.

1. Is there a way to make the possible values of a enum data-driven instead of hardcoded in the workflow?
For example, something like
<activiti:formProperty id="vacationApproved" type="enum" required="true" activiti:values="${someBean.someMethod()}"/>2. Is there a way to create a list or multi-select type? I want to specify a variable/form property that represents a collection.
For example, something like
<activiti:formProperty id="vacationApproved" type="list" required="true" />3. If there is a list type, is there a way to specify the value of types stored in that list?
For example, something like
<activiti:formProperty id="vacationApproved" type="list" required="true">
    <activiti:containedValues type="enum"> …. </activiti:containedValues>
</activiti:formProperty>

frederikherema1
Star Contributor
Star Contributor
There is nothing like that implemented right now. However, it's possible to define your own types, see Jorams blog-post for a good summary:

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

oconnor0
Champ in-the-making
Champ in-the-making
Thanks for the information.

chopper
Champ in-the-making
Champ in-the-making
would i have to alter org.activiti.engine.impl.form.FormTypes (parseFormPropertyType()) to be able to access an additional attribute activiti:values like:
<code>
<activiti:formProperty id="vacationApproved" type="enum" required="true" activiti:values="${someBean.someMethod()}"/>
</code>

from the custom formtype?

trademak
Star Contributor
Star Contributor
Yes, you need to do some custom development there. You would also need to change the way the form property is parsed in the activiti-bpmn-converter project.

Best regards,