5. Form Property Types
Forms are defined using <flowable:formProperty> within <extensionElements>.
| Type | HTML Rendering | Notes |
|---|---|---|
string |
Text input | Standard text field |
long |
Number input | For integer values |
double |
Number input | For decimal values |
boolean |
Checkbox | True/false values |
date |
DateTime picker | Date and time selection, stored as java.util.Date |
enum |
Dropdown / Radio | Predefined options (Radio: ≤4 options, Dropdown: >4 options) |
Custom Type Hints (Value Attribute)
Use <activiti:value id="type" name="..."/> for special rendering:
| Hint | Renders As | Usage |
|---|---|---|
textarea |
Multi-line text area | Long text, descriptions |
datetime |
DateTime picker | Explicit datetime input |
file |
File upload | Attach documents |
label |
Informative text label | Display a value as styled read-only text, not an input field |
list |
Multiple read-only labels | Expands a JSON array variable into N separate labels (see Variable Aggregation) |
<!-- Textarea example -->
<activiti:formProperty id="description" name="Description" type="string" required="true">
<activiti:value id="type" name="textarea"/>
</activiti:formProperty>
<!-- File upload via type hint -->
<activiti:formProperty id="report_doc" name="Report Document" type="string" required="true">
<activiti:value id="type" name="file"/>
</activiti:formProperty>
File Type Restrictions (Accept Attribute)
You can restrict which file types a file upload field accepts using the accept value attribute. This filters the file picker in the browser and validates the file type on the server when submitted.
If no accept value is provided, all file types are accepted (default behaviour).
Available Categories
Use these category names to allow common groups of file types:
| Category | Extensions |
|---|---|
documents |
.doc, .docx, .odt |
text |
.txt, .rtf |
pdf |
.pdf |
spreadsheets |
.xls, .xlsx, .ods, .csv |
images |
.jpg, .jpeg, .png, .gif, .webp, .svg, .bmp, .tiff |
presentations |
.ppt, .pptx, .odp |
archives |
.zip, .rar, .7z, .tar, .gz |
audio |
.mp3, .wav, .ogg, .flac, .aac, .m4a, .ac3 |
video |
.mp4, .avi, .mkv, .mov, .webm, .wmv, .mpeg |
Usage Examples
<!-- Accept only documents (PDF, Word, etc.) -->
<activiti:formProperty id="report_doc" name="Report Document" type="string" required="true">
<activiti:value id="type" name="file"/>
<activiti:value id="accept" name="documents"/>
</activiti:formProperty>
<!-- Accept documents and images -->
<activiti:formProperty id="attachment" name="Attachment" type="string">
<activiti:value id="type" name="file"/>
<activiti:value id="accept" name="documents,images"/>
</activiti:formProperty>
<!-- Accept only specific extensions -->
<activiti:formProperty id="data_file" name="Data File" type="string" required="true">
<activiti:value id="type" name="file"/>
<activiti:value id="accept" name=".xls,.xlsx,.csv"/>
</activiti:formProperty>
<!-- Mix categories with raw extensions -->
<activiti:formProperty id="mixed" name="Mixed File" type="string">
<activiti:value id="type" name="file"/>
<activiti:value id="accept" name="documents,.csv"/>
</activiti:formProperty>
Note: If an unrecognized category name is used (e.g. a typo), the BPMN Validation Service will show a warning during upload but will not block deployment.
Dynamic Labels (User-Entered Notes Shown as Text)
Use the label type hint combined with writable="false" to display a process variable as plain informative text instead of a disabled input field. This is ideal for showing notes, instructions, or context written by a previous user in the workflow.
How it works:
- In one task, the user enters text into a normal form field (stored as a process variable).
- In a subsequent task, the same variable is rendered as a styled text label using the
labeltype hint.
Difference from writable="false" alone:
writable="false"renders a greyed-out, disabled input field.writable="false"+labeltype hint renders clean, styled text — visually distinct from form inputs.
<!-- Task 1: Manager writes a note (normal editable textarea) -->
<userTask id="managerReview" name="Manager Review" flowable:assignee="${manager}">
<extensionElements>
<activiti:formProperty id="managerNote" name="Note for Employee" type="string">
<activiti:value id="type" name="textarea"/>
</activiti:formProperty>
<activiti:formProperty id="decision" name="Decision" type="enum" required="true">
<activiti:value id="approve" name="Approve"/>
<activiti:value id="reject" name="Reject"/>
</activiti:formProperty>
</extensionElements>
</userTask>
<!-- Task 2: Employee sees the manager's note as a label (not an input) -->
<userTask id="notifyEmployee" name="View Result" flowable:assignee="${initiator}">
<extensionElements>
<activiti:formProperty id="managerNote" name="Manager's Note" type="string" writable="false">
<activiti:value id="type" name="label"/>
</activiti:formProperty>
</extensionElements>
</userTask>
Tip: You can also use the
labeltype hint with adefaultvalue (no prior task needed) to show static informative text as a form field label:<activiti:formProperty id="info" name="Notice" type="string" writable="false" default="All submissions are final and cannot be changed."> <activiti:value id="type" name="label"/> </activiti:formProperty>
Field Permissions & Visibility
You can control how fields appear in the form using standard BPMN attributes:
| Attribute | Value | Behavior | Use Case |
|---|---|---|---|
| writable | "false" |
Disabled Input: Field is visible but greyed out (read-only). | Showing context from previous tasks that shouldn't be changed. |
| readable | "false" |
Hidden: Field is completely hidden from the UI. | Storing hidden variables or validation rules. |
<!-- Read-Only (Disabled) Field -->
<activiti:formProperty id="originalRequest" name="Original Request" type="string" writable="false"/>
<!-- Hidden Field (e.g., for internal logic) -->
<activiti:formProperty id="internalStatus" name="Status" type="string" readable="false"/>
Task Documentation (Static Labels)
You can add static informational text to any User Task using the standard BPMN <documentation> element. This text is displayed as a highlighted label at the top of the task form, above the form fields.
- The text is static — it is defined in the BPMN XML and appears the same on every instance of the workflow.
- Each task can have its own
<documentation>, so different tasks in the same process can show different instructions. - Long text wraps automatically.
- If no
<documentation>is present, nothing is shown.
<!-- Task with static instructions -->
<userTask id="reviewTask" name="Review Request" flowable:assignee="${initiator}">
<documentation>Please review all attached documents carefully before making your decision.</documentation>
<extensionElements>
<activiti:formProperty id="decision" name="Decision" type="enum" required="true">
<activiti:value id="approve" name="Approve"/>
<activiti:value id="reject" name="Reject"/>
</activiti:formProperty>
</extensionElements>
</userTask>
<!-- Another task with different instructions -->
<userTask id="uploadTask" name="Upload Documents" flowable:assignee="${initiator}">
<documentation>Upload the signed contract and any supporting documents. Maximum 3 files.</documentation>
<extensionElements>
<activiti:formProperty id="file_contract" name="Contract" type="string" required="true">
<activiti:value id="type" name="file"/>
</activiti:formProperty>
</extensionElements>
</userTask>
Note:
<documentation>is a standard BPMN 2.0 element, not a Flowable extension. It is placed directly inside the<userTask>element, before<extensionElements>.