feat(REQ-3982) - 结合 Cursor 调整代码

This commit is contained in:
wangli 2025-04-23 14:11:15 +08:00
parent 8713355e50
commit d503a133a9
42 changed files with 43 additions and 109 deletions

View File

@ -13,7 +13,6 @@ import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
@ -84,7 +83,7 @@ public class WorkflowEngineClientAutoConfiguration {
Map<String, String> env = new HashMap<>();
env.put("create", "true");
try {
FileSystem zipfs = FileSystems.newFileSystem(location.toURI(), env);
FileSystems.newFileSystem(location.toURI(), env);
} catch (Exception e1) {
log.error("linux env create new FS error: {}", e1.getMessage());
}
@ -102,7 +101,7 @@ public class WorkflowEngineClientAutoConfiguration {
Map<String, String> env = new HashMap<>();
env.put("create", "true");
try {
FileSystem zipfs = FileSystems.newFileSystem(location.toURI(), env);
FileSystems.newFileSystem(location.toURI(), env);
} catch (Exception e) {
log.error("linux env create new FS error: {}", e.getMessage());
}

View File

@ -3,7 +3,6 @@ package cn.axzo.workflow.client.feign.bpmn;
import cn.axzo.workflow.client.annotation.WorkflowEngineFeignClient;
import cn.axzo.workflow.common.annotation.InvokeMode;
import cn.axzo.workflow.common.annotation.Manageable;
import cn.axzo.workflow.common.enums.RpcInvokeModeEnum;
import cn.axzo.workflow.common.model.request.bpmn.activity.BpmnActivityTimeoutCallbackDTO;
import cn.axzo.workflow.common.model.request.bpmn.activity.BpmnActivityTimeoutTriggerDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnActivitySetAssigneeDTO;

View File

@ -1,12 +1,10 @@
package cn.axzo.workflow.client.feign.bpmn;
import cn.axzo.workflow.client.annotation.WorkflowEngineFeignClient;
import cn.axzo.workflow.client.config.CommonFeignConfiguration;
import cn.axzo.workflow.common.annotation.InvokeMode;
import cn.axzo.workflow.common.annotation.Manageable;
import cn.axzo.workflow.common.model.request.bpmn.RestBpmnProcessVariable;
import cn.azxo.framework.common.model.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;

View File

@ -1,7 +1,6 @@
package cn.axzo.workflow.client.feign.manage;
import cn.axzo.workflow.client.annotation.WorkflowEngineFeignClient;
import cn.axzo.workflow.client.config.CommonFeignConfiguration;
import cn.axzo.workflow.common.annotation.InvokeMode;
import cn.axzo.workflow.common.annotation.Manageable;
import cn.axzo.workflow.common.model.request.category.CategoryConfigCreateDTO;
@ -13,7 +12,6 @@ import cn.axzo.workflow.common.model.response.BpmPageResult;
import cn.axzo.workflow.common.model.response.category.CategoryConfigItemVO;
import cn.axzo.workflow.common.model.response.category.CategoryItemVO;
import cn.azxo.framework.common.model.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;

View File

@ -1,12 +1,10 @@
package cn.axzo.workflow.client.feign.manage;
import cn.axzo.workflow.client.annotation.WorkflowEngineFeignClient;
import cn.axzo.workflow.client.config.CommonFeignConfiguration;
import cn.axzo.workflow.common.annotation.InvokeMode;
import cn.axzo.workflow.common.annotation.Manageable;
import cn.axzo.workflow.common.model.request.bpmn.BpmnButtonMetaInfo;
import cn.azxo.framework.common.model.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.List;

View File

@ -4,7 +4,6 @@ import cn.axzo.framework.data.mybatisplus.model.BaseEntity;
import cn.axzo.workflow.common.enums.AdminDataSource;
import cn.axzo.workflow.common.enums.AdminRoleType;
import cn.axzo.workflow.common.enums.AdminTypeEnum;
import cn.axzo.workflow.common.enums.WorkspaceType;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

View File

@ -44,7 +44,7 @@ public enum BpmnProcessInstanceResultEnum {
* @param result 结果
* @return 是否
*/
public static boolean isEndResult(Integer result) {
public static boolean isEndResult(String result) {
return Arrays.asList(PROCESSING.getStatus(), APPROVED.getStatus(), REJECTED.getStatus(),
CANCELLED.getStatus()).contains(result);
}

View File

@ -85,10 +85,12 @@ public abstract class CommonContext<T> implements OperationContext {
}
@Override
@SuppressWarnings("unchecked")
public void setContext(OperationContext context) {
this.context = (T) context;
}
@SuppressWarnings("unchecked")
@Override
public T getContext() {
return context;

View File

@ -5,15 +5,12 @@ import cn.axzo.workflow.core.repository.entity.ExtAxApiLog;
import cn.axzo.workflow.core.service.ExtAxApiLogService;
import cn.hutool.json.JSONUtil;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.MDC;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;

View File

@ -5,13 +5,10 @@ import cn.axzo.workflow.common.model.request.bpmn.BpmnCarbonCopyConf;
import cn.axzo.workflow.common.model.request.bpmn.BpmnJsonNode;
import org.flowable.bpmn.model.ExtensionAttribute;
import org.flowable.bpmn.model.ExtensionElement;
import org.flowable.bpmn.model.FlowableListener;
import org.flowable.bpmn.model.Process;
import org.flowable.bpmn.model.ServiceTask;
import org.flowable.bpmn.model.UserTask;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

View File

@ -38,6 +38,7 @@ public class PreTaskUserProcessor implements ApproverScopeProcessor {
// 上级节点
String preActivityId = preUserTaskOpt.get().getId();
// 获取上一级节点
@SuppressWarnings("unchecked")
List<BpmnTaskDelegateAssigner> assigners = (List<BpmnTaskDelegateAssigner>) execution
.getVariableLocal(INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT + preActivityId);
List<OrgScope> entOrg = CollectionUtils.emptyIfNull(assigners).stream()

View File

@ -1,7 +1,7 @@
package cn.axzo.workflow.core.engine.cmd;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import cn.axzo.workflow.common.exception.WorkflowEngineException;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper;
import com.alibaba.fastjson.JSON;
import org.flowable.common.engine.impl.interceptor.CommandContext;
@ -24,16 +24,16 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import static cn.axzo.workflow.common.code.BpmnInstanceRespCode.PROCESS_INSTANCE_ID_NOT_EXISTS;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.ACTIVITY_BIZ_SET_ASSIGNEE_ERROR;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.ACTIVITY_CANT_SET_ASSIGNEE;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.PROCESS_CANT_SET_ASSIGNEE;
import static cn.axzo.workflow.common.constant.BpmnConstants.HIDDEN_ASSIGNEE_ID;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT;
import static cn.axzo.workflow.common.constant.BpmnConstants.NO_ASSIGNEE;
import static cn.axzo.workflow.common.constant.BpmnConstants.TASK_COMPLETE_OPERATION_TYPE;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.DELETED;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.PROCESSING;
import static cn.axzo.workflow.common.code.BpmnInstanceRespCode.PROCESS_INSTANCE_ID_NOT_EXISTS;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.ACTIVITY_BIZ_SET_ASSIGNEE_ERROR;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.ACTIVITY_CANT_SET_ASSIGNEE;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.PROCESS_CANT_SET_ASSIGNEE;
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.validTaskAssignerCount;
/**
@ -133,6 +133,7 @@ public class CustomBizSpecifyAssigneeToTaskCmd extends AbstractCommand<Boolean>
CommandContextUtil.getProcessEngineConfiguration(commandContext);
RuntimeService runtimeService = processEngineConfiguration.getRuntimeService();
@SuppressWarnings("unchecked")
List<BpmnTaskDelegateAssigner> originAssingeeList = runtimeService.getVariable(task.getProcessInstanceId(),
INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT + task.getTaskDefinitionKey(), List.class);

View File

@ -23,9 +23,7 @@ import org.springframework.util.CollectionUtils;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@ -37,7 +35,6 @@ import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.COUNTE
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.batchAddAttachment;
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.completeVirtualTask;
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.createVirtualTask;
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.deleteMultiTasks;
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.getDuplicatePendingTasks;
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.validTask;
import static cn.axzo.workflow.core.engine.cmd.helper.CustomTaskHelper.validTaskAssignerCount;

View File

@ -9,7 +9,6 @@ import cn.axzo.workflow.core.engine.listener.EngineExecutionStartListener;
import cn.axzo.workflow.core.engine.model.NoticeFlowElement;
import cn.axzo.workflow.core.service.converter.BpmnHistoricTaskInstanceConverter;
import com.alibaba.fastjson.JSON;
import org.flowable.common.engine.impl.interceptor.Command;
import org.flowable.common.engine.impl.interceptor.CommandContext;
import org.flowable.engine.HistoryService;
import org.flowable.engine.RuntimeService;

View File

@ -1,9 +1,6 @@
package cn.axzo.workflow.core.engine.cmd;
import org.flowable.bpmn.model.TimerEventDefinition;
import org.flowable.common.engine.impl.interceptor.CommandContext;
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.flowable.engine.impl.util.CommandContextUtil;
import java.io.Serializable;

View File

@ -138,6 +138,7 @@ public class CustomTransferUserTaskCmd extends AbstractCommand<Void> implements
public void processAssignee(ProcessEngineConfigurationImpl processEngineConfiguration, Task task) {
RuntimeService runtimeService = processEngineConfiguration.getRuntimeService();
@SuppressWarnings("unchecked")
List<BpmnTaskDelegateAssigner> originAssingeeList = runtimeService.getVariable(task.getProcessInstanceId(),
INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT + task.getTaskDefinitionKey(), List.class);
List<BpmnTaskDelegateAssigner> resultList = new ArrayList<>();

View File

@ -1,7 +1,6 @@
package cn.axzo.workflow.core.engine.job;
import cn.axzo.workflow.common.model.request.bpmn.process.BpmnProcessInstanceAbortDTO;
import cn.axzo.workflow.common.model.request.bpmn.process.BpmnProcessInstanceCancelDTO;
import cn.axzo.workflow.core.engine.cmd.CustomAbortProcessInstanceCmd;
import cn.axzo.workflow.core.service.ExtAxHiTaskInstService;
import cn.hutool.json.JSONUtil;

View File

@ -1,8 +1,6 @@
package cn.axzo.workflow.core.engine.job;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskAuditDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskAuditWithFormDTO;
import cn.axzo.workflow.core.engine.cmd.CustomApproveTaskCmd;
import cn.axzo.workflow.core.engine.cmd.CustomApproveTaskWithFormCmd;
import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;

View File

@ -3,10 +3,7 @@ package cn.axzo.workflow.core.engine.job.service;
import cn.axzo.workflow.common.constant.LogFieldConstants;
import cn.axzo.workflow.core.engine.job.utils.AsyncJobUtils;
import cn.azxo.framework.common.constatns.Constants;
import cn.hutool.json.JSONUtil;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.flowable.job.service.JobProcessor;
import org.flowable.job.service.JobProcessorContext;
import org.flowable.job.service.impl.persistence.entity.AbstractJobEntity;

View File

@ -30,11 +30,22 @@ import java.util.Date;
import java.util.List;
import java.util.Objects;
import static cn.axzo.workflow.common.constant.BpmnConstants.*;
import static cn.axzo.workflow.common.constant.BpmnConstants.AND_SIGN_EXPRESSION;
import static cn.axzo.workflow.common.constant.BpmnConstants.COMMENT_TYPE_ADVICE;
import static cn.axzo.workflow.common.constant.BpmnConstants.COMMENT_TYPE_OPERATION_DESC;
import static cn.axzo.workflow.common.constant.BpmnConstants.HIDDEN_ASSIGNEE_ID;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_INFO;
import static cn.axzo.workflow.common.constant.BpmnConstants.NO_ASSIGNEE;
import static cn.axzo.workflow.common.constant.BpmnConstants.TASK_COMPLETE_OPERATION_TYPE;
import static cn.axzo.workflow.common.enums.ApprovalMethodEnum.nobody;
import static cn.axzo.workflow.common.enums.BpmnFlowNodeMode.*;
import static cn.axzo.workflow.common.enums.BpmnFlowNodeMode.AND;
import static cn.axzo.workflow.common.enums.BpmnFlowNodeMode.GENERAL;
import static cn.axzo.workflow.common.enums.BpmnFlowNodeMode.OR;
import static cn.axzo.workflow.common.enums.BpmnFlowNodeType.NODE_STARTER;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.*;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.APPROVED;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.DELETED;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.PROCESSING;
import static cn.axzo.workflow.core.common.enums.BpmnProcessTaskResultEnum.PENDING;
import static cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper.getActivitySignature;
import static cn.axzo.workflow.core.common.utils.BpmnMetaParserHelper.getApprovalMethod;
@ -114,6 +125,7 @@ public class TaskEntityEventHandle implements EntityEventHandle<TaskEntity> {
} else {
ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration();
RuntimeService runtimeService = processEngineConfiguration.getRuntimeService();
@SuppressWarnings("unchecked")
List<BpmnTaskDelegateAssigner> assigneeList = runtimeService.getVariable(taskEntity.getProcessInstanceId(),
INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT + taskEntity.getTaskDefinitionKey(), List.class);
ListUtils.emptyIfNull(assigneeList).stream().filter(e -> Objects.equals(e.buildAssigneeId(), taskEntity.getAssignee())).findAny()
@ -180,6 +192,7 @@ public class TaskEntityEventHandle implements EntityEventHandle<TaskEntity> {
// 判断是否抄送节点如果是的话需要将抄送人集合放入对应字段
if (isCarbonCopyNode(queryLog)) {
// 抄送人集合
@SuppressWarnings("unchecked")
List<BpmnTaskDelegateAssigner> carbonCopies = runtimeService.getVariable(taskEntity.getProcessInstanceId(), INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT + taskEntity.getTaskDefinitionKey(), List.class);
update.setAssigneeFull(carbonCopies);
update.setOperationDesc("抄送" + carbonCopies.size() + "");

View File

@ -17,11 +17,13 @@ public abstract class AbstractBpmnEventListener<T extends OperationContext> impl
private T context;
@SuppressWarnings("unchecked")
@Override
public void setContext(OperationContext context) {
this.context = (T) context;
}
@SuppressWarnings("unchecked")
@Override
public T getContext() {
return context;

View File

@ -4,7 +4,6 @@ import cn.axzo.workflow.common.model.request.bpmn.activity.BpmnActivityTimeoutCa
import cn.axzo.workflow.common.model.request.bpmn.activity.BpmnActivityTimeoutTriggerDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnActivitySetAssigneeDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnActivityTriggerDTO;
import org.flowable.job.service.impl.persistence.entity.JobEntity;
/**
* 流程活动的 Service

View File

@ -4,7 +4,6 @@ import cn.axzo.workflow.common.model.dto.BpmnFormRelationCreateDTO;
import cn.axzo.workflow.common.model.dto.BpmnFormRelationSearchDTO;
import cn.axzo.workflow.common.model.response.BpmPageResult;
import cn.axzo.workflow.core.repository.entity.ExtAxBpmnFormRelation;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;

View File

@ -1,10 +1,8 @@
package cn.axzo.workflow.core.service;
import cn.axzo.workflow.common.model.dto.BpmnFormRelationSearchDTO;
import cn.axzo.workflow.common.model.request.form.definition.FormDefinitionSearchDTO;
import cn.axzo.workflow.common.model.request.form.definition.StartFormSearchDTO;
import cn.axzo.workflow.common.model.request.form.instance.FormDetailDTO;
import cn.axzo.workflow.common.model.request.form.instance.FormInstanceSearchDTO;
import cn.axzo.workflow.common.model.response.form.FormVO;
import cn.axzo.workflow.common.model.response.form.definition.FormDefinitionVO;
import cn.axzo.workflow.common.model.response.form.instance.FormInstanceVO;

View File

@ -11,7 +11,6 @@ import org.flowable.engine.HistoryService;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.engine.history.HistoricProcessInstanceQuery;
import org.flowable.engine.impl.HistoryServiceImpl;
import org.flowable.spring.SpringProcessEngineConfiguration;
import org.flowable.variable.api.history.HistoricVariableInstance;
import org.springframework.context.annotation.Lazy;

View File

@ -897,7 +897,7 @@ public class BpmnProcessInstanceServiceImpl implements BpmnProcessInstanceServic
NativeHistoricProcessInstanceQuery countSqlQuery = query.sql(countSql(baseQuerySql));
if (StringUtils.hasText(dto.getKey())) {
return new BpmPageResult(historicProcessInstanceConverter.toVos(instances, dto.getKey()),
return new BpmPageResult<>(historicProcessInstanceConverter.toVos(instances, dto.getKey()),
countSqlQuery.count());
} else {
Set<String> procDefIds = new HashSet<>();
@ -909,7 +909,7 @@ public class BpmnProcessInstanceServiceImpl implements BpmnProcessInstanceServic
List<HistoricProcessInstanceVO> vos = new ArrayList<>();
instances.forEach(i -> vos.add(historicProcessInstanceConverter.toVo(i,
defCategoryMap.getOrDefault(i.getProcessDefinitionId(), ""))));
return new BpmPageResult(vos, countSqlQuery.count());
return new BpmPageResult<>(vos, countSqlQuery.count());
}
}

View File

@ -6,20 +6,6 @@ import cn.axzo.workflow.common.enums.BpmnFlowNodeType;
import cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum;
import cn.axzo.workflow.common.exception.WorkflowEngineException;
import cn.axzo.workflow.common.model.request.bpmn.BpmnNoticeConf;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnOptionalNodeDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnRobotTaskCompleteDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnRobotTaskCreateDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskAttachmentDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskAuditDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskAuditWithFormDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskBackAuditDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskCommentDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskCountersignDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskPageSearchDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskRemindDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskTransferDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.ExtHiTaskSearchDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnNodeBackSystemOperateDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnOptionalNodeDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnRobotTaskCompleteDTO;
@ -131,33 +117,6 @@ import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import static cn.axzo.workflow.common.code.BpmnInstanceRespCode.PROCESS_INSTANCE_ID_NOT_EXISTS;
import static cn.axzo.workflow.common.code.BpmnInstanceRespCode.PROCESS_INSTANCE_NOT_EXISTS;
import static cn.axzo.workflow.common.code.BpmnInstanceRespCode.PROCESS_TASK_NOT_EXISTS;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.BACK_NODE_CANNOT_REACHABLE;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.FIND_TASK_BY_PERSON_ID_ERROR;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.REACHED_BACKED_MAXIMUM_NUM;
import static cn.axzo.workflow.common.code.BpmnTaskRespCode.TASK_REMIND_ERROR_NOT_EXISTS;
import static cn.axzo.workflow.common.constant.BpmnConstants.COMMENT_TYPE_ADVICE;
import static cn.axzo.workflow.common.constant.BpmnConstants.COMMENT_TYPE_COMMENT_EXT;
import static cn.axzo.workflow.common.constant.BpmnConstants.COMMENT_TYPE_OPERATION_DESC;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_INFO;
import static cn.axzo.workflow.common.constant.BpmnConstants.MAX_BACKED_OPERATE_COUNT;
import static cn.axzo.workflow.common.constant.BpmnConstants.NO_ASSIGNEE;
import static cn.axzo.workflow.common.constant.BpmnConstants.OLD_INTERNAL_TASK_RELATION_ASSIGNEE_INFO_SNAPSHOT;
import static cn.axzo.workflow.common.constant.BpmnConstants.WORKFLOW_ENGINE_VERSION;
import static cn.axzo.workflow.common.enums.BpmnFlowNodeType.NODE_BUSINESS;
import static cn.axzo.workflow.common.enums.BpmnFlowNodeType.NODE_CARBON_COPY;
import static cn.axzo.workflow.common.enums.BpmnFlowNodeType.NODE_EMPTY;
import static cn.axzo.workflow.common.enums.BpmnFlowNodeType.NODE_STARTER;
import static cn.axzo.workflow.common.enums.BpmnFlowNodeType.NODE_TASK;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.APPROVED;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.BACKED;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.DELETED;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.PROCESSING;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.REJECTED;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.valueOfStatus;
import static cn.axzo.workflow.common.code.BpmnInstanceRespCode.PROCESS_INSTANCE_ID_NOT_EXISTS;
import static cn.axzo.workflow.common.code.BpmnInstanceRespCode.PROCESS_INSTANCE_NOT_EXISTS;
import static cn.axzo.workflow.common.code.BpmnInstanceRespCode.PROCESS_TASK_NOT_EXISTS;
@ -928,6 +887,7 @@ public class BpmnProcessTaskServiceImpl implements BpmnProcessTaskService {
Process process = ProcessDefinitionUtil.getProcess(processInstance.getProcessDefinitionId());
Optional<BpmnNoticeConf> noticeConfig =
BpmnMetaParserHelper.getNoticeConfig(process);
@SuppressWarnings("unchecked")
List<BpmnTaskDelegateAssigner> assigners =
(List<BpmnTaskDelegateAssigner>) runtimeService.getVariable(dto.getProcessInstanceId(),
INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT + dto.getTaskDefinitionKey());

View File

@ -19,7 +19,7 @@ import javax.annotation.Resource;
import java.util.List;
import java.util.Objects;
import static cn.axzo.workflow.common.code.BpmnModelRespCode.MODEL_ID_NOT_EXISTS;
import static cn.axzo.workflow.common.code.BpmnModelRespCode.MODEL_NOT_EXISTS;
/**
@ -57,7 +57,7 @@ public class ExtAxReModelServiceImpl implements ExtAxReModelService {
public void changeStatus(String modelId, Integer status, ExtModelStateFieldEnum field) {
ExtAxReModel reModel = extAxReModelMapper.selectOne(new QueryWrapper<ExtAxReModel>().eq("model_id", modelId));
if (Objects.isNull(reModel)) {
throw new WorkflowEngineException(MODEL_ID_NOT_EXISTS, reModel.getModelId());
throw new WorkflowEngineException(MODEL_NOT_EXISTS);
}
if (Objects.equals(field, ExtModelStateFieldEnum.status)) {
reModel.setStatus(status);
@ -78,7 +78,7 @@ public class ExtAxReModelServiceImpl implements ExtAxReModelService {
public void printTemplateConfig(PrintTemplateConfigUpsertDTO dto) {
ExtAxReModel model = extAxReModelMapper.selectOne(new QueryWrapper<ExtAxReModel>().eq("model_id", dto.getModelId()));
if (Objects.isNull(model)) {
throw new WorkflowEngineException(MODEL_ID_NOT_EXISTS, model.getModelId());
throw new WorkflowEngineException(MODEL_NOT_EXISTS);
}
if (Objects.nonNull(dto.getPrintFileName())) {
model.setPrintFileName(dto.getPrintFileName());
@ -102,7 +102,7 @@ public class ExtAxReModelServiceImpl implements ExtAxReModelService {
public PrintModelDTO getPrintTemplateConfig(String modelId) {
ExtAxReModel model = extAxReModelMapper.selectOne(new QueryWrapper<ExtAxReModel>().eq("model_id", modelId));
if (Objects.isNull(model)) {
throw new WorkflowEngineException(MODEL_ID_NOT_EXISTS, model.getModelId());
throw new WorkflowEngineException(MODEL_NOT_EXISTS);
}
return PrintModelDTO.builder()
.printFileName(model.getPrintFileName())

View File

@ -2,13 +2,11 @@ package org.flowable.engine.impl.cmd;
import cn.axzo.workflow.core.engine.cmd.AbstractCommand;
import com.alibaba.fastjson.JSON;
import liquibase.pro.packaged.M;
import org.flowable.common.engine.api.FlowableException;
import org.flowable.common.engine.api.FlowableObjectNotFoundException;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEventType;
import org.flowable.common.engine.api.delegate.event.FlowableEventDispatcher;
import org.flowable.common.engine.impl.identity.Authentication;
import org.flowable.common.engine.impl.interceptor.Command;
import org.flowable.common.engine.impl.interceptor.CommandContext;
import org.flowable.common.engine.impl.persistence.entity.ByteArrayEntity;
import org.flowable.common.engine.impl.util.IoUtil;

View File

@ -4,7 +4,6 @@ package cn.axzo.workflow.form.service;
import cn.axzo.workflow.common.model.request.form.instance.FormContentUpdateDTO;
import cn.axzo.workflow.common.model.request.form.instance.FormInstanceSearchDTO;
import cn.axzo.workflow.common.model.response.form.instance.FormInstanceVO;
import org.flowable.form.api.FormInstanceInfo;
/**
* 表单实例相关接口

View File

@ -9,8 +9,6 @@ import org.flowable.common.engine.api.FlowableOptimisticLockingException;
import org.flowable.common.engine.impl.interceptor.CommandContext;
import org.springframework.stereotype.Component;
import static cn.axzo.framework.domain.web.code.BaseCode.UNAVAILABLE_FOR_LEGAL_REASONS;
/**
* 降级 FlowableOptimisticLockingException 异常该异常在 Flowable 框架中是可以忽略的
*

View File

@ -1,7 +1,6 @@
package cn.axzo.workflow.server.common.util;
import cn.hutool.core.date.DateUtil;
import liquibase.pro.packaged.D;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.StringUtils;

View File

@ -73,6 +73,7 @@ public class BasedInitiatorSpecifiedTaskAssigneeSelector extends AbstractBpmnTas
*/
private void populateAssigneeByInitiatorSpecify(List<BpmnTaskDelegateAssigner> assigners, FlowElement flowElement, DelegateExecution execution) {
String processInstanceId = execution.getProcessInstanceId();
@SuppressWarnings("unchecked")
Map<String, List<BpmnTaskDelegateAssigner>> initiatorSpecifyMap = runtimeService.getVariable(processInstanceId, INITIATOR_SPECIFY, Map.class);
if (CollectionUtils.isEmpty(initiatorSpecifyMap)) {
return;

View File

@ -13,7 +13,6 @@ import cn.hutool.core.collection.CollUtil;
import lombok.extern.slf4j.Slf4j;
import org.flowable.bpmn.model.FlowElement;
import org.flowable.engine.delegate.DelegateExecution;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;

View File

@ -363,6 +363,7 @@ public class RocketMqMessagePushEventListener extends AbstractBpmnEventListener<
historyService.createHistoricTaskInstanceQuery().taskId(event.getTaskId()).list();
if (!CollectionUtils.isEmpty(tasks)) {
// 应该只有 1 , 但是为了防止有多个, 这里只取第一个
@SuppressWarnings("unchecked")
List<BpmnTaskDelegateAssigner> assigners =
(List<BpmnTaskDelegateAssigner>) originVariables.getOrDefault(INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT + tasks.get(0).getTaskDefinitionKey(), Collections.emptyList());
assigners.stream().filter(i -> Objects.equals(i.buildAssigneeId(), tasks.get(0).getAssignee())).findAny()

View File

@ -6,14 +6,12 @@ import cn.axzo.workflow.common.enums.ElasticSearchEventEnum;
import cn.axzo.workflow.core.common.context.ProcessOperationContext;
import cn.axzo.workflow.core.listener.AbstractBpmnEventListener;
import cn.axzo.workflow.core.listener.BpmnProcessEventListener;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;
import org.flowable.engine.delegate.event.FlowableCancelledEvent;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.core.Ordered;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;

View File

@ -128,6 +128,7 @@ public class MessagePushTaskEvent_103_Listener extends AbstractBpmnEventListener
.processInstanceId(delegateTask.getProcessInstanceId())
.includeProcessVariables()
.singleResult());
@SuppressWarnings("unchecked")
List<BpmnTaskDelegateAssigner> assigners =
(List<BpmnTaskDelegateAssigner>) processInstance.getProcessVariables()
.getOrDefault(INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT + delegateTask.getTaskDefinitionKey(), Collections.emptyList());

View File

@ -46,6 +46,7 @@ public class SnapshotBpmnTaskEvent_100_Listener extends AbstractBpmnEventListene
@Override
public void onAssigned(DelegateTask delegateTask) {
log.info("SnapshotBpmnTaskTaskEventListener#onAssigned...{}, processInstanceId:{}", delegateTask.getTaskDefinitionKey(), delegateTask.getProcessInstanceId());
@SuppressWarnings("unchecked")
List<BpmnTaskDelegateAssigner> assignerList = runtimeService.getVariable(delegateTask.getProcessInstanceId(),
INTERNAL_ACTIVITY_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT + delegateTask.getTaskDefinitionKey(),
List.class);

View File

@ -11,7 +11,6 @@ import org.flowable.task.service.delegate.DelegateTask;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.core.Ordered;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;

View File

@ -215,6 +215,7 @@ public class BpmnProcessDefinitionController implements ProcessDefinitionApi {
updateDTO.setTenantId(modelDetail.getTenantId());
updateDTO.setJsonModel(processDefinition.getJsonModel());
@SuppressWarnings("unchecked")
Map<String, String> metaInfoMap = JSON.parseObject(modelDetail.getMetaInfo(), Map.class);
updateDTO.setDescription(metaInfoMap.get(MODEL_DESCRIPTION));

View File

@ -3,12 +3,7 @@ package cn.axzo.workflow.server.mq.inside;
import cn.axzo.framework.rocketmq.BaseListener;
import cn.axzo.framework.rocketmq.EventConsumer;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;

View File

@ -10,12 +10,9 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.HistoryService;
import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.engine.impl.cfg.ProcessEngineConfigurationImpl;
import org.flowable.engine.impl.util.CommandContextUtil;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
/**