@SuppressWarnings("unchecked")
@RequestMapping(value = "get-form/task/{taskId}")
@ResponseBody
public Map<String, Object> findTaskForm(@PathVariable("taskId") String taskId) throws Exception {
Map<String, Object> result = new HashMap<String, Object>();
TaskFormDataImpl taskFormData = (TaskFormDataImpl) formService.getTaskFormData(taskId);
// 设置task为null,否则输出json的时候会报错
taskFormData.setTask(null);
result.put("taskFormData", taskFormData);
/*
* 读取enum类型数据,用于下拉框
*/
List<FormProperty> formProperties = taskFormData.getFormProperties();
for (FormProperty formProperty : formProperties) {
Map<String, String> values = (Map<String, String>) formProperty.getType().getInformation("values");
if (values != null) {
for (Entry<String, String> enumEntry : values.entrySet()) {
logger.debug("enum, key: {}, value: {}", enumEntry.getKey(), enumEntry.getValue());