Skip to content

Commit

Permalink
xuhuisheng#34 限制只把当前表单填写的数据设置到流程变量里,这样可以避免之前表单设置的变量被覆盖,覆盖时因为读取不到类型,导致…
Browse files Browse the repository at this point in the history
…转换失败
  • Loading branch information
xuhuisheng committed Dec 24, 2013
1 parent de8327c commit 0b976a2
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/main/java/com/mossle/form/web/form/FormAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ public String startProcessInstance() throws Exception {
if ("userPicker".equals(formType)) {
processParameters.put(key,
new ArrayList(Arrays.asList(value.split(","))));
} else {
} else if (formType != null) {
processParameters.put(key, value);
}
}
Expand Down Expand Up @@ -283,7 +283,7 @@ private String getFormType(Map<String, String> formTypeMap, String name) {
if (formTypeMap.containsKey(name)) {
return formTypeMap.get(name);
} else {
return "textfield";
return null;
}
}

Expand Down Expand Up @@ -353,12 +353,14 @@ public String completeTask() throws Exception {
Map map = jsonMapper.fromJson(content, Map.class);
logger.info("map : {}", map);

List<Map> list = (List<Map>) map.get("fields");
logger.info("list : {}", list);
if (map != null) {
List<Map> list = (List<Map>) map.get("fields");
logger.info("list : {}", list);

for (Map item : list) {
formTypeMap.put((String) item.get("name"),
(String) item.get("type"));
for (Map item : list) {
formTypeMap.put((String) item.get("name"),
(String) item.get("type"));
}
}
}

Expand All @@ -376,7 +378,7 @@ public String completeTask() throws Exception {
if ("userPicker".equals(formType)) {
processParameters.put(key,
new ArrayList(Arrays.asList(value.split(","))));
} else {
} else if (formType != null) {
processParameters.put(key, value);
}
}
Expand Down

0 comments on commit 0b976a2

Please sign in to comment.