fix: 修复开始表单旧工作流兼容回退

- 避免旧开始节点缺失 user_input 时运行态强行注入系统问题字段

- 补充运行参数解析兼容测试并收口 M12 尾项
This commit is contained in:
2026-04-19 14:11:07 +08:00
parent 9feb889637
commit 51198ff492
2 changed files with 49 additions and 1 deletions

View File

@@ -128,6 +128,10 @@ public class WorkflowRunningParameterResolver {
JSONArray rawSchema = startNodeData == null ? null : startNodeData.getJSONArray("startFormSchema");
List<Map<String, Object>> schema = new ArrayList<>();
Set<String> seenKeys = new LinkedHashSet<>();
boolean hasExplicitSchema = rawSchema != null;
boolean hasSystemParameter = parameters.stream().anyMatch(parameter ->
SYSTEM_START_PARAM_NAME.equals(trimToNull(parameter == null ? null : parameter.getName()))
);
if (rawSchema != null && !rawSchema.isEmpty()) {
for (int i = 0; i < rawSchema.size(); i++) {
JSONObject field = rawSchema.getJSONObject(i);
@@ -163,7 +167,7 @@ public class WorkflowRunningParameterResolver {
}
}
}
if (!seenKeys.contains(SYSTEM_START_PARAM_NAME)) {
if (!seenKeys.contains(SYSTEM_START_PARAM_NAME) && (hasExplicitSchema || hasSystemParameter)) {
schema.add(0, normalizeStartFormField(new JSONObject(), null));
}
return schema;