FormService.getTaskFormData return empty FormProperty LIst

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2011 04:54 AM
I'm trying to retrieve the list of FormProperty of a defined form in process definition, here the part of the code I'm using:
I obtain the the formFields is always empty, however the task is correct and have e form definition as below:
Do you see my error ?
Any Ideas ?
Thx in advance
Task selectMedia = taskService.createTaskQuery().singleResult(); Assert.assertEquals("selectMedia", selectMedia.getName()); TaskFormData selectMediaForm = formService.getTaskFormData(selectMedia.getId()); List<FormProperty> formFields = selectMediaForm.getFormProperties();
I obtain the the formFields is always empty, however the task is correct and have e form definition as below:
<startEvent id="startevent1" name="Start"></startEvent> <userTask id="selectMedia" name="selectMedia" activiti:candidateGroups="ControlloCrediti.solleciti" activiti:formKey="ControlloCrediti.solleciti"> <extensionElements> <activiti:formProperty id="media" name="Media" type="string" required="true" readable="false" writable="true"></activiti:formProperty> </extensionElements> </userTask>
Do you see my error ?
Any Ideas ?
Thx in advance
Labels:
- Labels:
-
Archive
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2011 05:03 AM
I looked into the form-properties handling code, and saw this:
You should set the readable attr your definition to true…
protected void initializeFormProperties(FormDataImpl formData, ExecutionEntity execution) {
List<FormProperty> formProperties = new ArrayList<FormProperty>();
for (FormPropertyHandler formPropertyHandler: formPropertyHandlers) {
if (formPropertyHandler.isReadable()) {
FormProperty formProperty = formPropertyHandler.createFormProperty(execution);
formProperties.add(formProperty);
}
}
formData.setFormProperties(formProperties);
}
You should set the readable attr your definition to true…

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2011 05:17 AM
I looked into the form-properties handling code, and saw this:
protected void initializeFormProperties(FormDataImpl formData, ExecutionEntity execution) {
List<FormProperty> formProperties = new ArrayList<FormProperty>();
for (FormPropertyHandler formPropertyHandler: formPropertyHandlers) {
if (formPropertyHandler.isReadable()) {
FormProperty formProperty = formPropertyHandler.createFormProperty(execution);
formProperties.add(formProperty);
}
}
formData.setFormProperties(formProperties);
}
You should set the readable attr your definition to true…
Works !! Thx
