Merge branch 'feature/REQ-5965' into dev

This commit is contained in:
wangli 2025-12-22 11:09:10 +08:00
commit a1cb68cafa
2 changed files with 14 additions and 0 deletions

View File

@ -119,6 +119,8 @@ public interface BpmnConstants {
String CONFIG_FIELD_PERMISSION = "fieldPermission";
String CONFIG_CONDITION_PERMISSION = "conditionPermission";
String CONFIG_FIELD_OPTIONS = "options";
@Deprecated
String CONFIG_FIELD_OPTION = "option";
String CONFIG_NODE_TYPE = "nodeType";
String CONFIG_BUTTON_TYPE_INITIATOR = "initiator";
String CONFIG_BUTTON_TYPE_CURRENT = "current";

View File

@ -86,6 +86,7 @@ import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_CARBON_COPY_
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_CONDITION_PERMISSION;
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD;
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD_META;
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD_OPTION;
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD_OPTIONS;
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_FIELD_PERMISSION;
import static cn.axzo.workflow.common.constant.BpmnConstants.CONFIG_INITIATOR_LEADER_RANGE_UNIT;
@ -436,6 +437,17 @@ public final class BpmnMetaParserHelper {
String fieldOptionsJsonStr = i.getAttributeValue(null, CONFIG_FIELD_OPTIONS);
if (StringUtils.hasText(fieldOptionsJsonStr)) {
conf.setOptions(JSON.parseArray(fieldOptionsJsonStr, BpmnFieldOptionConf.class));
} else {
List<BpmnFieldOptionConf> options = new ArrayList<>();
if (!CollectionUtils.isEmpty(i.getChildElements())) {
i.getChildElements().get(CONFIG_FIELD_OPTION).forEach(j -> {
BpmnFieldOptionConf option = new BpmnFieldOptionConf();
option.setName(j.getAttributeValue(null, ELEMENT_ATTRIBUTE_NAME));
option.setValue(j.getAttributeValue(null, ELEMENT_ATTRIBUTE_VALUE));
options.add(option);
});
conf.setOptions(options);
}
}
fields.add(conf);