update - 调整 json 转换

This commit is contained in:
wangli 2023-12-05 00:43:25 +08:00
parent 5a5fc62457
commit a56f2a9514
5 changed files with 2464 additions and 8 deletions

View File

@ -446,7 +446,7 @@ public final class BpmnJsonConverterUtil {
// branch == node_condition
BpmnJsonNode nextJsonNode = Objects.isNull(branch.getChildren()) ? bpmnJsonNode.getChildren() :
branch.getChildren();
if (Objects.nonNull(nextJsonNode)) {
if (Objects.nonNull(nextJsonNode) && Objects.nonNull(nextJsonNode.getType()) && !Objects.equals(NODE_EMPTY, nextJsonNode.getType())) {
nextJsonNode.setIncoming(Lists.newArrayList(gateway.getId()));
@ -463,7 +463,8 @@ public final class BpmnJsonConverterUtil {
gateway.setDefaultFlow(sequenceFlow.getId());
}
if (Objects.nonNull(branch.getChildren()) && StringUtils.hasLength(branch.getChildren().getId())) {
if (Objects.nonNull(branch.getChildren()) && StringUtils.hasLength(branch.getChildren().getId())
&& !Objects.equals(NODE_EMPTY, branch.getChildren().getType())) {
branchLastNodeIds.addAll(create(branch.getChildren(), mainProcess, bpmnModel));
}
}
@ -540,7 +541,7 @@ public final class BpmnJsonConverterUtil {
// String fileName = "/Users/wangli/work/company/yizhi/workflow-engine/workflow-engine-server/src/main" +
// "/resources/权限点模型.json";
String fileName = "/Users/wangli/work/company/yizhi/workflow-engine/workflow-engine-server/src/main" +
"/resources/ruchang.json";
"/resources/temp2.json";
byte[] bytes = Files.readAllBytes(Paths.get(fileName));
String content = new String(bytes, StandardCharsets.UTF_8);

View File

@ -22,7 +22,6 @@ import org.springframework.context.ApplicationContextAware;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Supplier;
import java.util.stream.Collectors;
@ -80,10 +79,9 @@ public abstract class AbstractBpmnTaskAssigneeSelector implements BpmnTaskAssign
// 默认解析格式[{"name":"预算员", "value":"xxxx"}]
try {
return BpmnMetaParserHelper.getApproverSpecifyValue(userTask)
.map(list -> list.stream().map(s -> Optional.ofNullable(JSON.parseObject(s).getString("value"))
.orElse(null))
.filter(Objects::nonNull)
.collect(Collectors.toList())).orElse(Collections.emptyList());
.map(strings -> strings.stream().map(i -> JSON.parseObject(i).getString("value"))
.collect(Collectors.toList()))
.orElse(Collections.emptyList());
} catch (Exception e) {
e.getStackTrace();
throw new WorkflowEngineException(CONVERTOR_META_DATA_FORMAT_ERROR);

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,344 @@
{
"jsonModel": {
"node": {
"id": "NODE_STARTER",
"parentId": null,
"type": "NODE_STARTER",
"name": "发起人",
"desc": "任何人",
"props": {
"assignedUser": [],
"formPerms": []
},
"children": {
"id": "node_068743086299",
"parentId": "NODE_STARTER",
"property": {},
"type": "NODE_EXCLUSIVE_GATEWAY",
"name": "条件分支",
"children": {
"id": "node_068743083177",
"parentId": "node_068743086299",
"type": "NODE_EMPTY",
"children": {}
},
"branches": [
{
"id": "node_068743083028",
"parentId": "node_068743086299",
"type": "NODE_CONDITION",
"property": {
"groupsType": "OR",
"groups": [
{
"conditionsType": "AND",
"conditions": [
{
"name": "1",
"code": "1",
"type": "string",
"defaultValues": [],
"defaultValue": "1",
"options": [
{
"name": "",
"value": ""
}
],
"operator": "contains"
}
]
}
],
"defaultBranch": false
},
"name": "条件1",
"children": {}
},
{
"id": "node_068743087250",
"parentId": "node_068743086299",
"type": "NODE_CONDITION",
"property": {
"groupsType": "OR",
"groups": [
{
"conditionsType": "AND",
"conditions": []
}
],
"defaultBranch": true
},
"name": "默认分支"
}
]
}
},
"noticeConf": {
"notice": {
"noticeMessageId": 590,
"viewJson": "{\"env\":\"[dev]\",\"relationId\":590,\"contactUser\":\"宋远伦\",\"moduleId\":24,\"moduleName\":\"项目公告\",\"receiveIdentityType\":3,\"bizType\":1,\"title\":\"补卡申请已完成审核\",\"content\":\"您提交的${workspaceName}${initiatorUserName}工人的考勤补卡申请已审核${processResult},点击查看详情\",\"routers\":[],\"createAt\":1701334576000,\"updateAt\":1701350719000}"
},
"pending": {
"pendingMessageId": "ae537bd074fd417bb5f223abffa9ab4e",
"viewJson": "{\"templateName\":\"逾期未发薪整改\",\"templateCode\":\"ae537bd074fd417bb5f223abffa9ab4e\",\"category\":\"BIZ_PENDING_MESSAGE\",\"title\":\"逾期未发薪电子整改单\",\"content\":\"${content}\",\"groupNodeNamePaths\":[\"CMS待办中心/整改待办/逾期预警\"],\"status\":\"ENABLE\"}"
},
"sms": {
"smsId": "",
"viewJson": ""
}
},
"buttonConf": {
"initiator": [
{
"order": 1,
"btnKey": "BPMN_APPROVE",
"btnName": "同意",
"checked": false,
"disabled": true
},
{
"order": 2,
"btnKey": "BPMN_REJECT",
"btnName": "拒绝",
"checked": false,
"disabled": true
},
{
"order": 3,
"btnKey": "BPMN_REVOCATION",
"btnName": "撤回",
"checked": true,
"disabled": false
},
{
"order": 4,
"btnKey": "BPMN_TRANSFER",
"btnName": "转办",
"checked": false,
"disabled": true
},
{
"order": 5,
"btnKey": "BPMN_COUNTERSIGN",
"btnName": "加签",
"checked": false,
"disabled": true
},
{
"order": 6,
"btnKey": "BPMN_COMMENT",
"btnName": "评论",
"checked": true,
"disabled": false
},
{
"order": 7,
"btnKey": "BPMN_ROLLBACK",
"btnName": "回退",
"checked": false,
"disabled": true
},
{
"order": 8,
"btnKey": "BPMN_COPY",
"btnName": "抄送",
"checked": false,
"disabled": true
}
],
"current": [
{
"order": 1,
"btnKey": "BPMN_APPROVE",
"btnName": "同意",
"checked": true,
"disabled": false
},
{
"order": 2,
"btnKey": "BPMN_REJECT",
"btnName": "拒绝",
"checked": true,
"disabled": false
},
{
"order": 3,
"btnKey": "BPMN_REVOCATION",
"btnName": "撤回",
"checked": false,
"disabled": true
},
{
"order": 4,
"btnKey": "BPMN_TRANSFER",
"btnName": "转办",
"checked": true,
"disabled": false
},
{
"order": 5,
"btnKey": "BPMN_COUNTERSIGN",
"btnName": "加签",
"checked": true,
"disabled": false
},
{
"order": 6,
"btnKey": "BPMN_COMMENT",
"btnName": "评论",
"checked": true,
"disabled": false
},
{
"order": 7,
"btnKey": "BPMN_ROLLBACK",
"btnName": "回退",
"checked": true,
"disabled": false
},
{
"order": 8,
"btnKey": "BPMN_COPY",
"btnName": "抄送",
"checked": true,
"disabled": false
}
],
"history": [
{
"order": 1,
"btnKey": "BPMN_APPROVE",
"btnName": "同意",
"checked": false,
"disabled": true
},
{
"order": 2,
"btnKey": "BPMN_REJECT",
"btnName": "拒绝",
"checked": false,
"disabled": true
},
{
"order": 3,
"btnKey": "BPMN_REVOCATION",
"btnName": "撤回",
"checked": false,
"disabled": true
},
{
"order": 4,
"btnKey": "BPMN_TRANSFER",
"btnName": "转办",
"checked": false,
"disabled": true
},
{
"order": 5,
"btnKey": "BPMN_COUNTERSIGN",
"btnName": "加签",
"checked": false,
"disabled": true
},
{
"order": 6,
"btnKey": "BPMN_COMMENT",
"btnName": "评论",
"checked": true,
"disabled": false
},
{
"order": 7,
"btnKey": "BPMN_ROLLBACK",
"btnName": "回退",
"checked": false,
"disabled": true
},
{
"order": 8,
"btnKey": "BPMN_COPY",
"btnName": "抄送",
"checked": false,
"disabled": true
}
],
"carbonCopy": [
{
"order": 1,
"btnKey": "BPMN_APPROVE",
"btnName": "同意",
"checked": false,
"disabled": true
},
{
"order": 2,
"btnKey": "BPMN_REJECT",
"btnName": "拒绝",
"checked": false,
"disabled": true
},
{
"order": 3,
"btnKey": "BPMN_REVOCATION",
"btnName": "撤回",
"checked": false,
"disabled": true
},
{
"order": 4,
"btnKey": "BPMN_TRANSFER",
"btnName": "转办",
"checked": false,
"disabled": true
},
{
"order": 5,
"btnKey": "BPMN_COUNTERSIGN",
"btnName": "加签",
"checked": false,
"disabled": true
},
{
"order": 6,
"btnKey": "BPMN_COMMENT",
"btnName": "评论",
"checked": true,
"disabled": false
},
{
"order": 7,
"btnKey": "BPMN_ROLLBACK",
"btnName": "回退",
"checked": false,
"disabled": true
},
{
"order": 8,
"btnKey": "BPMN_COPY",
"btnName": "抄送",
"checked": false,
"disabled": true
}
]
},
"fieldConf": [
{
"name": "1",
"code": "1",
"type": "string",
"defaultValues": [],
"defaultValue": "",
"options": [
{
"name": "",
"value": ""
}
]
}
]
},
"name": "111",
"category": 20,
"remark": ""
}