update warm-flow 1.3.4 => 1.3.5 优化流程图导入

This commit is contained in:
疯狂的狮子Li 2024-12-20 10:36:21 +08:00
parent f19202d8a3
commit 08585f7bc8

View File

@ -16,15 +16,11 @@ import org.dom4j.io.XMLWriter;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.StreamUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.common.core.utils.reflect.ReflectUtils;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.dromara.warm.flow.core.dto.FlowCombine;
import org.dromara.warm.flow.core.entity.Definition;
import org.dromara.warm.flow.core.entity.Node;
import org.dromara.warm.flow.core.entity.Skip;
import org.dromara.warm.flow.core.service.DefService;
import org.dromara.warm.flow.core.utils.FlowConfigUtil;
import org.dromara.warm.flow.orm.entity.FlowDefinition;
import org.dromara.warm.flow.orm.entity.FlowHisTask;
import org.dromara.warm.flow.orm.mapper.FlowDefinitionMapper;
@ -97,15 +93,11 @@ public class FlwDefinitionServiceImpl implements IFlwDefinitionService {
@Override
public boolean importXml(MultipartFile file, String category) {
try {
FlowCombine combine = FlowConfigUtil.readConfig(file.getInputStream());
FlowCombine combine = defService.readXml(file.getInputStream());
// 流程定义
Definition definition = combine.getDefinition();
definition.setCategory(category);
// 所有的流程节点
List<Node> allNodes = combine.getAllNodes();
// 所有的流程连线
List<Skip> allSkips = combine.getAllSkips();
ReflectUtils.invoke(defService, "insertFlow", definition, allNodes, allSkips);
defService.importFlow(combine);
} catch (Exception e) {
log.error("导入流程定义错误: {}", e.getMessage(), e);
throw new RuntimeException(e);