chore: 部分文件更名
This commit is contained in:
parent
735ec9e3ac
commit
60d1f1199d
|
@ -6,7 +6,6 @@ import lombok.Getter;
|
|||
|
||||
import java.util.Arrays;
|
||||
|
||||
// TODO @lesan:BpmListenerParamTypeEnum
|
||||
/**
|
||||
* BPM 任务监听器键值对类型
|
||||
*
|
||||
|
@ -14,7 +13,7 @@ import java.util.Arrays;
|
|||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BpmListenerMapType implements IntArrayValuable {
|
||||
public enum BpmListenerParamTypeEnum implements IntArrayValuable {
|
||||
|
||||
FIXED_VALUE(1, "固定值"),
|
||||
FROM_FORM(2, "表单");
|
||||
|
@ -22,7 +21,7 @@ public enum BpmListenerMapType implements IntArrayValuable {
|
|||
private final Integer type;
|
||||
private final String name;
|
||||
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmListenerMapType::getType).toArray();
|
||||
public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(BpmListenerParamTypeEnum::getType).toArray();
|
||||
|
||||
@Override
|
||||
public int[] array() {
|
|
@ -113,13 +113,9 @@ public class BpmSimpleModelNodeVO {
|
|||
*/
|
||||
private ConditionGroups conditionGroups; // 仅用于条件节点 BpmSimpleModelNodeType.CONDITION_NODE
|
||||
|
||||
// TODO @lesan:route 改成 router 会不会好点。因为触发器、延迟器,都带了类似 r
|
||||
|
||||
// TODO @lesan:routeGroups
|
||||
@Schema(description = "路由分支组", example = "[]")
|
||||
private List<RouteCondition> routeGroup;
|
||||
private List<RouteCondition> routerGroups;
|
||||
|
||||
// TODO @lesan:貌似没用???
|
||||
@Schema(description = "默认分支 ID", example = "Flow_xxx")
|
||||
private String defaultFlowId; // 仅用于路由分支节点 BpmSimpleModelNodeType.ROUTE_BRANCH_NODE
|
||||
|
||||
|
@ -136,20 +132,19 @@ public class BpmSimpleModelNodeVO {
|
|||
private String path;
|
||||
|
||||
@Schema(description = "请求头", example = "[]")
|
||||
private List<ListenerMap> header;
|
||||
private List<ListenerParam> header;
|
||||
|
||||
@Schema(description = "请求体", example = "[]")
|
||||
private List<ListenerMap> body;
|
||||
private List<ListenerParam> body;
|
||||
|
||||
// TODO @芋艿:这里后续要不要复用;
|
||||
|
||||
// TODO @lesan:ListenerParam 更合适哈。首先它是参数配置,然后形式是键值对
|
||||
@Schema(description = "任务监听器键值对")
|
||||
@Data
|
||||
public static class ListenerMap {
|
||||
public static class ListenerParam {
|
||||
|
||||
@Schema(description = "值类型", example = "1")
|
||||
@InEnum(BpmListenerMapType.class)
|
||||
@InEnum(BpmListenerParamTypeEnum.class)
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "键", example = "xxx")
|
||||
|
@ -300,7 +295,6 @@ public class BpmSimpleModelNodeVO {
|
|||
@NotEmpty(message = "节点 Id 不能为空")
|
||||
private String nodeId;
|
||||
|
||||
// TODO @lesan:type、expression、groups;
|
||||
@Schema(description = "条件类型", example = "1")
|
||||
@InEnum(BpmSimpleModeConditionType.class)
|
||||
@NotNull(message = "条件类型不能为空")
|
||||
|
|
|
@ -200,7 +200,7 @@ public class SimpleModelUtils {
|
|||
// 3. 遍历分支节点
|
||||
if (nodeType == BpmSimpleModelNodeType.ROUTE_BRANCH_NODE) {
|
||||
// 路由分支遍历
|
||||
for (BpmSimpleModelNodeVO.RouteCondition route : node.getRouteGroups()) {
|
||||
for (BpmSimpleModelNodeVO.RouteCondition route : node.getRouterGroups()) {
|
||||
SequenceFlow sequenceFlow = RouteBranchNodeConvert.buildSequenceFlow(node.getId(), route);
|
||||
process.addFlowElement(sequenceFlow);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package cn.iocoder.yudao.module.bpm.service.task.listener;
|
|||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.model.simple.BpmSimpleModelNodeVO;
|
||||
import cn.iocoder.yudao.module.bpm.enums.definition.BpmListenerMapType;
|
||||
import cn.iocoder.yudao.module.bpm.enums.definition.BpmListenerParamTypeEnum;
|
||||
import cn.iocoder.yudao.module.bpm.framework.flowable.core.util.BpmnModelUtils;
|
||||
import cn.iocoder.yudao.module.bpm.service.definition.BpmModelService;
|
||||
import cn.iocoder.yudao.module.bpm.service.task.BpmProcessInstanceService;
|
||||
|
@ -84,16 +84,16 @@ public class BpmUserTaskListener implements TaskListener {
|
|||
// 4. 是否需要后续操作?TODO 芋艿:待定!
|
||||
}
|
||||
|
||||
private void parseListenerMap(List<BpmSimpleModelNodeVO.ListenerHandler.ListenerMap> list,
|
||||
private void parseListenerMap(List<BpmSimpleModelNodeVO.ListenerHandler.ListenerParam> list,
|
||||
Map<String, Object> processVariables,
|
||||
MultiValueMap<String, String> to) {
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
return;
|
||||
}
|
||||
list.forEach(item -> {
|
||||
if (item.getType().equals(BpmListenerMapType.FIXED_VALUE.getType())) {
|
||||
if (item.getType().equals(BpmListenerParamTypeEnum.FIXED_VALUE.getType())) {
|
||||
to.add(item.getKey(), item.getValue());
|
||||
} else if (item.getType().equals(BpmListenerMapType.FROM_FORM.getType())) {
|
||||
} else if (item.getType().equals(BpmListenerParamTypeEnum.FROM_FORM.getType())) {
|
||||
to.add(item.getKey(), processVariables.get(item.getValue()).toString());
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue