update - 调整工程内部文件命名, 补充工程说明

This commit is contained in:
wangli 2023-11-01 14:33:23 +08:00
parent 2b6581f66a
commit d2ed296d63
59 changed files with 350 additions and 292 deletions

32
ProjectDesc.md Normal file
View File

@ -0,0 +1,32 @@
## 1. 本工程结构说明
- workflow-engine-api: Feign 接口 module, 采用 SpringBoot Starter 方式对外提供, 该报中使用对象模型, 都引用自 common 模块.
需要特别注意的是, 由于绝大部分的 Feign API 都会提供对应的 WebApi, 但由于 MVC 与 OpenFeign 默认不会同时解析对应的
MappingAdapter, 而目前所有的 Feign API 的实现都是 Server 模块中的 Controller, 所以在 Server 模块中的 Controller 需要单独设置
Feign 的请求路径.
- workflow-engine-common: 通用的公共模型以及常量
- workflow-engine-core: 该 module 的目的是以 jar 包的方式,提供给二/三方应用集成,而不依赖本工程.
- workflow-engine-server: 本工程的启动目录, 提供 Web 相关功能以及特性
## 2. 启动方式
> 在 workflow-engine-server 模块下, 设置好了 bootstrap.yml, 一般情况直接设置对应的 active profiles 即可.
> 由于各个环境中的组件地址可能存在配置的是基于 K8S DNS 的内网域名,本地启动会无法连接, 所以建议通过 VM Options/ Program
> arguments/ Environment 等方式对 Nacos 中的默认配置进行覆盖即可.
>
> **严禁随意调整 Bootstrap.yml 配置文件内容**
目前提供了四种 Profile 的 nacos 地址配置信息
- local: 一般用于本地开发
> 该环境比较特殊, 用于连接自己本地的数据库, 注意账号密码请用本地覆盖
> ```text
> -Dspring.datasource.username=root -Dspring.datasource.password=123456
> ```
> ![start-config.png](imgs/start-config.png)
- dev: 一般用于开发联调
- test: 一般用于提测
- pre: 一般用于上线前验收

View File

@ -269,9 +269,9 @@ act_ge_bytearray (很多元数据)
**广播的事件接口**
- cn.axzo.workflow.core.listener.BpmActivityEventListener
- cn.axzo.workflow.core.listener.BpmTaskEventListener
- cn.axzo.workflow.core.listener.BpmProcessEventListener
- cn.axzo.workflow.core.listener.BpmnActivityEventListener
- cn.axzo.workflow.core.listener.BpmnTaskEventListener
- cn.axzo.workflow.core.listener.BpmnProcessEventListener
**以下总结下哪些接口触发哪些事件**
@ -301,12 +301,7 @@ act_ge_bytearray (很多元数据)
> 1. 当前审批任务会触发 process-task-deleted 事件
> 2. 当前流程实例会触发 process-instance-rejected 事件
## 7. 本工程结构说明
- workflow-engine-api: Feign 接口包,采用 SpringBoot Starter 方式对外提供
- workflow-engine-common: 通用的公共模型以及常量
- workflow-engine-core:
- workflow-engine-server
## 99.建设状态(过时)

BIN
imgs/start-config.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.common.constant;
public interface BpmConstants {
public interface BpmnConstants {
String BPMN_FILE_SUFFIX = ".bpmn";
String FORM_FILE_SUFFIX = ".form";

View File

@ -1,7 +1,7 @@
package cn.axzo.workflow.common.enums;
public enum BpmFlowNodeType {
public enum BpmnFlowNodeType {
//0 发起人 1审批 2抄送 3条件 4路由
NODE_STARTER("NODE_STARTER", "发起人节点"), // ROOT
@ -19,7 +19,7 @@ public enum BpmFlowNodeType {
private String type;
private String desc;
BpmFlowNodeType(String type, String desc) {
BpmnFlowNodeType(String type, String desc) {
this.type = type;
this.desc = desc;
}

View File

@ -2,7 +2,7 @@ package cn.axzo.workflow.common.enums;
import java.util.Arrays;
public enum BpmProcessInstanceResultEnum {
public enum BpmnProcessInstanceResultEnum {
PROCESSING("PROCESSING", "审批中"),
APPROVED("APPROVED", "已通过"),
REJECTED("REJECTED", "已驳回"),
@ -17,7 +17,7 @@ public enum BpmProcessInstanceResultEnum {
*/
private final String desc;
BpmProcessInstanceResultEnum(String status, String desc) {
BpmnProcessInstanceResultEnum(String status, String desc) {
this.status = status;
this.desc = desc;
}
@ -43,7 +43,7 @@ public enum BpmProcessInstanceResultEnum {
CANCELLED.getStatus()).contains(result);
}
public static BpmProcessInstanceResultEnum valueOfStatus(String status) {
public static BpmnProcessInstanceResultEnum valueOfStatus(String status) {
return Arrays.stream(values()).filter(it -> it.getStatus().equals(status)).findFirst()
.orElse(null);
}

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.common.model.request.bpmn;
import cn.axzo.workflow.common.enums.BpmFlowNodeType;
import cn.axzo.workflow.common.enums.BpmnFlowNodeType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -28,7 +28,7 @@ public class BpmnJsonNode {
@ApiModelProperty(value = "父节点ID")
private String parentId;
@ApiModelProperty(value = "节点类型")
private BpmFlowNodeType type;
private BpmnFlowNodeType type;
@ApiModelProperty(value = "节点名称")
private String name;
@ApiModelProperty(value = "子节点信息")
@ -60,11 +60,11 @@ public class BpmnJsonNode {
this.parentId = parentId;
}
public BpmFlowNodeType getType() {
public BpmnFlowNodeType getType() {
return type;
}
public void setType(BpmFlowNodeType type) {
public void setType(BpmnFlowNodeType type) {
this.type = type;
}

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.common.model.request.bpmn.process;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum;
import cn.axzo.workflow.common.model.request.BpmPageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -31,7 +31,7 @@ public class BpmnProcessInstanceMyPageReqVO extends BpmPageParam {
private String businessKey;
@ApiModelProperty(value = "审核状态(PROCESSING:审核中,APPROVED:已通过,REJECTED:已拒绝,CANCELLED:已取消)", example = "APPROVED")
private BpmProcessInstanceResultEnum result;
private BpmnProcessInstanceResultEnum result;
@ApiModelProperty(value = "自定义分类")
private String category;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.common.model.request.bpmn.task;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum;
import cn.axzo.workflow.common.model.request.BpmPageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -37,7 +37,7 @@ public class BpmnTaskPageSearchDTO extends BpmPageParam {
private String businessKey;
@ApiModelProperty(value = "审核状态(PROCESSING:审核中,APPROVED:已通过,REJECTED:已拒绝,CANCELLED:已取消)", example = "APPROVED")
private List<BpmProcessInstanceResultEnum> results;
private List<BpmnProcessInstanceResultEnum> results;
@ApiModelProperty(value = "流程任务名", example = "芋道")
private String name;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.common.model.response.bpmn.process;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -24,7 +24,7 @@ public class BpmnProcessInstancePageItemVO {
private String category;
@ApiModelProperty(value = "审核状态(PROCESSING:审核中,APPROVED:已通过,REJECTED:已拒绝,CANCELLED:已取消)", example = "APPROVED")
private BpmProcessInstanceResultEnum result;
private BpmnProcessInstanceResultEnum result;
@ApiModelProperty(value = "提交时间", required = true)
private Date startTime;

View File

@ -1,7 +1,7 @@
package cn.axzo.workflow.common.model.response.bpmn.process;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -27,7 +27,7 @@ public class BpmnProcessInstanceVO {
private String category;
@ApiModelProperty(value = "审核状态(PROCESSING:审核中,APPROVED:已通过,REJECTED:已拒绝,CANCELLED:已取消)", example = "APPROVED")
private BpmProcessInstanceResultEnum result;
private BpmnProcessInstanceResultEnum result;
@ApiModelProperty(value = "提交时间")
private Date createAt;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.common.model.response.bpmn.task;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -24,7 +24,7 @@ public class BpmnHistoricTaskInstanceGroupVO {
private String processInstanceId;
@ApiModelProperty(value = "审批任务节点的最终的状态")
private BpmProcessInstanceResultEnum result;
private BpmnProcessInstanceResultEnum result;
@ApiModelProperty(value = "该审批节点下的所有任务")
private List<BpmnHistoricTaskInstanceVO> tasks;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.common.model.response.bpmn.task;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -50,7 +50,7 @@ public class BpmnHistoricTaskInstanceVO {
private String tenantId;
@ApiModelProperty(value = "审核状态(PROCESSING:审核中,APPROVED:已通过,REJECTED:已拒绝,CANCELLED:已取消)", example = "APPROVED")
private BpmProcessInstanceResultEnum result;
private BpmnProcessInstanceResultEnum result;
@ApiModelProperty(value = "任务审批意见")
private String advice;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.common.model.response.bpmn.task;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -22,7 +22,7 @@ public class BpmnTaskDonePageItemVO extends BpmnTaskTodoPageItemVO {
private Long durationInMillis;
@ApiModelProperty(value = "审核状态(PROCESSING:审核中,APPROVED:已通过,REJECTED:已拒绝,CANCELLED:已取消)", example = "APPROVED")
private BpmProcessInstanceResultEnum result;
private BpmnProcessInstanceResultEnum result;
@ApiModelProperty(value = "审批建议", required = true, example = "不请假了!")
private String comment;

View File

@ -11,7 +11,7 @@ import lombok.Getter;
*/
@Getter
@AllArgsConstructor
public enum BpmErrorCode implements IProjectRespCode {
public enum BpmnErrorCode implements IProjectRespCode {
// ========== category 01-001 ==========
CATEGORY_VALUE_EXISTS("01001", "分类值【{}】已经存在"),
CATEGORY_ID_NOT_EXISTS("01002", "指定分类【{}】不存在"),

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.core.common.enums;
public enum BpmProcessInstanceStatusEnum {
public enum BpmnProcessInstanceStatusEnum {
RUNNING(1, "进行中"),
FINISH(2, "已完成");
@ -13,7 +13,7 @@ public enum BpmProcessInstanceStatusEnum {
*/
private final String desc;
BpmProcessInstanceStatusEnum(Integer status, String desc) {
BpmnProcessInstanceStatusEnum(Integer status, String desc) {
this.status = status;
this.desc = desc;
}

View File

@ -1,7 +1,7 @@
package cn.axzo.workflow.core.common.utils;
import cn.axzo.workflow.common.enums.BpmFlowNodeType;
import cn.axzo.workflow.common.enums.BpmnFlowNodeMode;
import cn.axzo.workflow.common.enums.BpmnFlowNodeType;
import cn.axzo.workflow.common.model.request.bpmn.BpmnJsonNode;
import cn.axzo.workflow.common.model.request.bpmn.BpmnJsonNodeProperty;
import cn.axzo.workflow.core.common.exception.WorkflowEngineException;
@ -35,13 +35,13 @@ import java.util.Objects;
import java.util.UUID;
import java.util.stream.Collectors;
import static cn.axzo.workflow.common.constant.BpmConstants.AND_SIGN_EXPRESSION;
import static cn.axzo.workflow.common.constant.BpmConstants.BPM_ALLOW_SKIP_USER_TASK;
import static cn.axzo.workflow.common.constant.BpmConstants.END_EVENT_ID;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO;
import static cn.axzo.workflow.common.constant.BpmConstants.OR_SIGN_EXPRESSION;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.CONVERTOR_META_DATA_FORMAT_ERROR;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.CONVERTOR_UNKNOW_NODE_TYPE;
import static cn.axzo.workflow.common.constant.BpmnConstants.AND_SIGN_EXPRESSION;
import static cn.axzo.workflow.common.constant.BpmnConstants.BPM_ALLOW_SKIP_USER_TASK;
import static cn.axzo.workflow.common.constant.BpmnConstants.END_EVENT_ID;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO;
import static cn.axzo.workflow.common.constant.BpmnConstants.OR_SIGN_EXPRESSION;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.CONVERTOR_META_DATA_FORMAT_ERROR;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.CONVERTOR_UNKNOW_NODE_TYPE;
import static org.flowable.bpmn.model.ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION;
import static org.flowable.engine.delegate.BaseExecutionListener.EVENTNAME_END;
import static org.flowable.engine.delegate.BaseExecutionListener.EVENTNAME_START;
@ -60,7 +60,7 @@ public class BpmTransformUtil {
process.setId(model.getKey());
process.setName(model.getName());
if (BpmFlowNodeType.NODE_STARTER.equals(bpmnJson.getType())) {
if (BpmnFlowNodeType.NODE_STARTER.equals(bpmnJson.getType())) {
process.addFlowElement(createStartEvent(bpmnJson.getId(), Objects.nonNull(bpmnJson.getProperty()) ?
bpmnJson.getProperty().getFormKey() : ""));
}
@ -114,7 +114,7 @@ public class BpmTransformUtil {
if (StringUtils.isNotBlank(parentId)) {
BpmnJsonNode parentNode = childNodeMap.get(parentId);
if (parentNode != null) {
if (BpmFlowNodeType.NODE_CONDITION.equals(parentNode.getType())) {
if (BpmnFlowNodeType.NODE_CONDITION.equals(parentNode.getType())) {
sequenceFlowId = parentNode.getId();
flow.setName(parentNode.getName());
if (!ObjectUtils.isEmpty(parentNode.getProperty()) && !Boolean.TRUE.equals(parentNode.getProperty().getDefaultBranch())) {
@ -162,9 +162,9 @@ public class BpmTransformUtil {
public static String create(String fromId, BpmnJsonNode flowNode, Process process, BpmnModel bpmnModel,
List<SequenceFlow> sequenceFlows, Map<String, BpmnJsonNode> childNodeMap) throws InvocationTargetException, IllegalAccessException {
String nodeType = flowNode.getType().getType();
if (BpmFlowNodeType.NODE_EXCLUSIVE_GATEWAY.isEqual(nodeType)) {
if (BpmnFlowNodeType.NODE_EXCLUSIVE_GATEWAY.isEqual(nodeType)) {
return createExclusiveGatewayBuilder(fromId, flowNode, process, bpmnModel, sequenceFlows, childNodeMap);
} else if (BpmFlowNodeType.NODE_TASK.isEqual(nodeType)) {
} else if (BpmnFlowNodeType.NODE_TASK.isEqual(nodeType)) {
childNodeMap.put(flowNode.getId(), flowNode);
Map incoming = flowNode.getIncoming();
incoming.put("incoming", Collections.singletonList(fromId));
@ -176,7 +176,7 @@ public class BpmTransformUtil {
} else {
return id;
}
} else if (BpmFlowNodeType.NODE_STARTER.isEqual(nodeType)) {
} else if (BpmnFlowNodeType.NODE_STARTER.isEqual(nodeType)) {
childNodeMap.put(flowNode.getId(), flowNode);
Map incoming = flowNode.getIncoming();
incoming.put("incoming", Collections.singletonList(fromId));
@ -277,7 +277,7 @@ public class BpmTransformUtil {
if (Objects.nonNull(childNode) && StringUtils.isNotBlank(childNode.getId())) {
String parentId = childNode.getParentId();
BpmnJsonNode parentChildNode = childNodeMap.get(parentId);
if (BpmFlowNodeType.NODE_EXCLUSIVE_GATEWAY.equals(parentChildNode.getType())) {
if (BpmnFlowNodeType.NODE_EXCLUSIVE_GATEWAY.equals(parentChildNode.getType())) {
String endExId = parentChildNode.getId() + "end";
process.addFlowElement(createExclusiveGateWayEnd(endExId));
if (incoming == null || incoming.isEmpty()) {

View File

@ -4,14 +4,24 @@ import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import com.google.common.collect.ImmutableMap;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.function.BinaryOperator;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.stream.Collectors;
public class BpmCollectionUtils {
public class BpmnCollectionUtils {
public static boolean containsAny(Object source, Object... targets) {
return Arrays.asList(targets).contains(source);

View File

@ -44,12 +44,12 @@ import java.util.Map;
import java.util.Objects;
import java.util.UUID;
import static cn.axzo.workflow.common.constant.BpmConstants.END_EVENT_ID;
import static cn.axzo.workflow.common.constant.BpmConstants.FLOW_NODE_JSON;
import static cn.axzo.workflow.common.constant.BpmConstants.SEQUENCE_FLOW_ID;
import static cn.axzo.workflow.common.constant.BpmConstants.START_EVENT_ID;
import static cn.axzo.workflow.common.enums.BpmFlowNodeType.NODE_EMPTY;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.CONVERTOR_COMMON_ERROR;
import static cn.axzo.workflow.common.constant.BpmnConstants.END_EVENT_ID;
import static cn.axzo.workflow.common.constant.BpmnConstants.FLOW_NODE_JSON;
import static cn.axzo.workflow.common.constant.BpmnConstants.SEQUENCE_FLOW_ID;
import static cn.axzo.workflow.common.constant.BpmnConstants.START_EVENT_ID;
import static cn.axzo.workflow.common.enums.BpmnFlowNodeType.NODE_EMPTY;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.CONVERTOR_COMMON_ERROR;
/**
* BPMN json 格式转换工具

View File

@ -15,17 +15,17 @@ import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
public class BpmMyBatisUtils {
public class BpmnMyBatisUtils {
private static final String MYSQL_ESCAPE_CHARACTER = "`";
public BpmMyBatisUtils() {
public BpmnMyBatisUtils() {
}
public static <T> Page<T> buildPage(BpmPageParam pageParam) {
return buildPage(pageParam, (Collection)null);
}
public static <T> Page<T> buildPage(BpmPageParam pageParam, Collection<BpmSortingField> sortingFields) {
public static <T> Page<T> buildPage(BpmPageParam pageParam, Collection<BpmnSortingField> sortingFields) {
Page<T> page = new Page((long)pageParam.getPageNo(), (long)pageParam.getPageSize());
if (!CollectionUtil.isEmpty(sortingFields)) {
page.addOrder((List)sortingFields.stream().map((sortingField) -> {

View File

@ -2,16 +2,16 @@ package cn.axzo.workflow.core.common.utils;
import java.io.Serializable;
public class BpmSortingField implements Serializable {
public class BpmnSortingField implements Serializable {
public static final String ORDER_ASC = "asc";
public static final String ORDER_DESC = "desc";
private String field;
private String order;
public BpmSortingField() {
public BpmnSortingField() {
}
public BpmSortingField(String field, String order) {
public BpmnSortingField(String field, String order) {
this.field = field;
this.order = order;
}
@ -20,7 +20,7 @@ public class BpmSortingField implements Serializable {
return this.field;
}
public BpmSortingField setField(String field) {
public BpmnSortingField setField(String field) {
this.field = field;
return this;
}
@ -29,7 +29,7 @@ public class BpmSortingField implements Serializable {
return this.order;
}
public BpmSortingField setOrder(String order) {
public BpmnSortingField setOrder(String order) {
this.order = order;
return this;
}

View File

@ -7,7 +7,7 @@ import org.flowable.bpmn.model.ExtensionAttribute;
import org.flowable.bpmn.model.FlowElement;
import org.flowable.bpmn.model.Process;
import static cn.axzo.workflow.common.constant.BpmConstants.FLOW_NODE_JSON;
import static cn.axzo.workflow.common.constant.BpmnConstants.FLOW_NODE_JSON;
/**
* TODO

View File

@ -4,7 +4,7 @@ import cn.axzo.workflow.common.model.request.bpmn.BpmnJsonNode;
import org.flowable.bpmn.model.EndEvent;
import org.flowable.bpmn.model.Process;
import static cn.axzo.workflow.common.constant.BpmConstants.END_EVENT_ID;
import static cn.axzo.workflow.common.constant.BpmnConstants.END_EVENT_ID;
/**
* 结束节点

View File

@ -5,7 +5,7 @@ import cn.axzo.workflow.core.common.exception.WorkflowEngineException;
import org.flowable.bpmn.model.FlowElement;
import org.flowable.bpmn.model.Process;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.CONVERTOR_NODE_TYPE_NOT_SUPPORT;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.CONVERTOR_NODE_TYPE_NOT_SUPPORT;
/**
* 默认的不支持的节点转换器

View File

@ -6,7 +6,7 @@ import org.flowable.bpmn.model.SequenceFlow;
import java.util.List;
import static cn.axzo.workflow.common.constant.BpmConstants.SEQUENCE_FLOW_ID;
import static cn.axzo.workflow.common.constant.BpmnConstants.SEQUENCE_FLOW_ID;
import static cn.axzo.workflow.core.common.utils.BpmnJsonConverterUtil.id;
/**

View File

@ -5,7 +5,7 @@ import cn.axzo.workflow.common.model.request.bpmn.BpmnJsonNode;
import org.flowable.bpmn.model.Process;
import org.flowable.bpmn.model.StartEvent;
import static cn.axzo.workflow.common.constant.BpmConstants.START_EVENT_ID;
import static cn.axzo.workflow.common.constant.BpmnConstants.START_EVENT_ID;
/**
* 开始节点

View File

@ -11,7 +11,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import static cn.axzo.workflow.common.enums.BpmFlowNodeType.NODE_STARTER;
import static cn.axzo.workflow.common.enums.BpmnFlowNodeType.NODE_STARTER;
import static org.flowable.bpmn.model.ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION;
/**

View File

@ -5,7 +5,7 @@ import lombok.Data;
import java.util.Map;
@Data
public class BpmTaskCalculateDTO {
public class BpmnTaskCalculateDTO {
/**
* 任务 ID, 工作流实例运行过程中产生的任务编号,用于对指定任务通过或拒绝

View File

@ -5,6 +5,6 @@ import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import java.util.List;
public interface BpmTaskDelegate {
List<BpmnTaskDelegateAssigner> calculateAssignerAtExecution(BpmTaskCalculateDTO delegateTask);
public interface BpmnTaskDelegate {
List<BpmnTaskDelegateAssigner> calculateAssignerAtExecution(BpmnTaskCalculateDTO delegateTask);
}

View File

@ -1,7 +1,7 @@
package cn.axzo.workflow.core.engine.listener;
import cn.axzo.framework.jackson.utility.JSON;
import cn.axzo.workflow.core.listener.BpmActivityEventListener;
import cn.axzo.workflow.core.listener.BpmnActivityEventListener;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.api.delegate.event.AbstractFlowableEventListener;
@ -30,7 +30,7 @@ import static org.flowable.common.engine.api.delegate.event.FlowableEngineEventT
public class EngineActivityEventListener extends AbstractFlowableEventListener {
@Resource
ObjectProvider<List<BpmActivityEventListener>> activityListeners;
ObjectProvider<List<BpmnActivityEventListener>> activityListeners;
@Override
public Collection<? extends FlowableEventType> getTypes() {
@ -49,8 +49,8 @@ public class EngineActivityEventListener extends AbstractFlowableEventListener {
return false;
}
private List<BpmActivityEventListener> getOrderedListeners() {
List<BpmActivityEventListener> orderListeners = new ArrayList<>();
private List<BpmnActivityEventListener> getOrderedListeners() {
List<BpmnActivityEventListener> orderListeners = new ArrayList<>();
activityListeners.ifAvailable(orderListeners::addAll);
if (log.isDebugEnabled()) {
log.debug("Order Lists: {}", JSON.toJSONString(orderListeners));

View File

@ -1,9 +1,9 @@
package cn.axzo.workflow.core.engine.listener;
import cn.axzo.workflow.common.constant.BpmConstants;
import cn.axzo.workflow.common.constant.BpmnConstants;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import cn.axzo.workflow.core.deletage.BpmTaskCalculateDTO;
import cn.axzo.workflow.core.deletage.BpmTaskDelegate;
import cn.axzo.workflow.core.deletage.BpmnTaskCalculateDTO;
import cn.axzo.workflow.core.deletage.BpmnTaskDelegate;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.flowable.bpmn.model.Process;
@ -20,9 +20,9 @@ import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import static cn.axzo.workflow.common.constant.BpmConstants.BPM_ALLOW_SKIP_USER_TASK;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT;
import static cn.axzo.workflow.common.constant.BpmnConstants.BPM_ALLOW_SKIP_USER_TASK;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT;
/**
@ -36,7 +36,7 @@ public class EngineExecutionStartListener implements ExecutionListener {
@Resource
private RepositoryService repositoryService;
@Resource
private ObjectProvider<BpmTaskDelegate> bpmTaskDelegate;
private ObjectProvider<BpmnTaskDelegate> bpmTaskDelegate;
@Override
public void notify(DelegateExecution execution) {
@ -48,7 +48,7 @@ public class EngineExecutionStartListener implements ExecutionListener {
Process mainProcess = repositoryService.getBpmnModel(execution.getProcessDefinitionId()).getMainProcess();
UserTask userTask = (UserTask) mainProcess.getFlowElement(currentActivityId);
BpmTaskCalculateDTO calculateDTO = new BpmTaskCalculateDTO();
BpmnTaskCalculateDTO calculateDTO = new BpmnTaskCalculateDTO();
calculateDTO.setTaskId(userTask.getId());
calculateDTO.setCategory(userTask.getCategory());
calculateDTO.setProcessDefinitionId(execution.getProcessDefinitionId());
@ -69,7 +69,7 @@ public class EngineExecutionStartListener implements ExecutionListener {
// 审批人为空并且当前节点设置了自动跳过条件
} else if (StringUtils.hasLength(userTask.getSkipExpression())) {
// 自动通过的默认引擎参数必须设置为 true
execution.setTransientVariable(BpmConstants.FLOWABLE_SKIP_EXPRESSION_ENABLE, true);
execution.setTransientVariable(BpmnConstants.FLOWABLE_SKIP_EXPRESSION_ENABLE, true);
// 设置当前 UserTask 使用的 skip 表达式
execution.setTransientVariable(BPM_ALLOW_SKIP_USER_TASK, true);
}

View File

@ -1,8 +1,8 @@
package cn.axzo.workflow.core.engine.listener;
import cn.axzo.framework.jackson.utility.JSON;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.core.listener.BpmProcessEventListener;
import cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum;
import cn.axzo.workflow.core.listener.BpmnProcessEventListener;
import com.google.common.collect.ImmutableSet;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;
@ -22,11 +22,11 @@ import java.util.List;
import java.util.Objects;
import java.util.Set;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_DELETE_PROCESS_FLAG;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_PROCESS_TYPE_CANCEL;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_PROCESS_TYPE_REJECT;
import static cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum.CANCELLED;
import static cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum.REJECTED;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_DELETE_PROCESS_FLAG;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_PROCESS_TYPE_CANCEL;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_PROCESS_TYPE_REJECT;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.CANCELLED;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.REJECTED;
/**
* 引擎全局的流程实例事件监听
@ -35,7 +35,7 @@ import static cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum.REJECTE
@Component
public class EngineProcessInstanceEventListener extends AbstractFlowableEngineEventListener {
@Resource
ObjectProvider<List<BpmProcessEventListener>> processEventListeners;
ObjectProvider<List<BpmnProcessEventListener>> processEventListeners;
@Resource
@Lazy
@ -60,14 +60,14 @@ public class EngineProcessInstanceEventListener extends AbstractFlowableEngineEv
@Override
protected void processStarted(FlowableProcessStartedEvent event) {
runtimeService.updateBusinessStatus(((FlowableProcessStartedEventImpl) event).getProcessInstanceId(),
BpmProcessInstanceResultEnum.PROCESSING.getStatus());
BpmnProcessInstanceResultEnum.PROCESSING.getStatus());
getOrderedListeners().forEach(i -> i.onStarted(event));
}
@Override
protected void processCompleted(FlowableEngineEntityEvent event) {
runtimeService.updateBusinessStatus(event.getProcessInstanceId(),
BpmProcessInstanceResultEnum.APPROVED.getStatus());
BpmnProcessInstanceResultEnum.APPROVED.getStatus());
getOrderedListeners().forEach(i -> i.onCompleted(event));
}
@ -75,7 +75,7 @@ public class EngineProcessInstanceEventListener extends AbstractFlowableEngineEv
protected void processCancelled(FlowableCancelledEvent event) {
String deleteProcessType = String.valueOf(runtimeService.getVariable(event.getExecutionId(),
INTERNAL_DELETE_PROCESS_FLAG));
BpmProcessInstanceResultEnum resultEnum;
BpmnProcessInstanceResultEnum resultEnum;
switch (deleteProcessType) {
case INTERNAL_PROCESS_TYPE_CANCEL:
resultEnum = CANCELLED;
@ -98,8 +98,8 @@ public class EngineProcessInstanceEventListener extends AbstractFlowableEngineEv
});
}
private List<BpmProcessEventListener> getOrderedListeners() {
List<BpmProcessEventListener> orderListeners = new ArrayList<>();
private List<BpmnProcessEventListener> getOrderedListeners() {
List<BpmnProcessEventListener> orderListeners = new ArrayList<>();
processEventListeners.ifAvailable(orderListeners::addAll);
if (log.isDebugEnabled()) {
log.debug("Order Lists: {}", JSON.toJSONString(orderListeners));

View File

@ -1,8 +1,8 @@
package cn.axzo.workflow.core.engine.listener;
import cn.axzo.framework.jackson.utility.JSON;
import cn.axzo.workflow.core.deletage.BpmTaskDelegate;
import cn.axzo.workflow.core.listener.BpmTaskEventListener;
import cn.axzo.workflow.core.deletage.BpmnTaskDelegate;
import cn.axzo.workflow.core.listener.BpmnTaskEventListener;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.delegate.TaskListener;
import org.flowable.task.service.delegate.DelegateTask;
@ -24,11 +24,11 @@ import java.util.List;
public class EngineTaskEventListener implements TaskListener {
@Resource
ObjectProvider<List<BpmTaskEventListener>> taskEventListeners;
ObjectProvider<List<BpmnTaskEventListener>> taskEventListeners;
@Resource
@Lazy
private BpmTaskDelegate taskDelegate;
private BpmnTaskDelegate taskDelegate;
@Override
public void notify(DelegateTask delegateTask) {
@ -56,8 +56,8 @@ public class EngineTaskEventListener implements TaskListener {
}
private List<BpmTaskEventListener> getOrderedListeners() {
List<BpmTaskEventListener> orderListeners = new ArrayList<>();
private List<BpmnTaskEventListener> getOrderedListeners() {
List<BpmnTaskEventListener> orderListeners = new ArrayList<>();
taskEventListeners.ifAvailable(orderListeners::addAll);
if (log.isDebugEnabled()) {
log.debug("Order Lists: {}", JSON.toJSONString(orderListeners));

View File

@ -14,7 +14,7 @@ import org.springframework.core.Ordered;
* @author wangli
* @since 2023/7/24 17:27
*/
public interface BpmActivityEventListener extends Ordered {
public interface BpmnActivityEventListener extends Ordered {
/**
* 由于Flowable BPMN Engine 没有直接对 UserTask 直接做相关事件,

View File

@ -10,7 +10,7 @@ import org.springframework.core.Ordered;
* <p>
* 微服版本使用, 统一在 Server module 中进行实现扩展, 不在该 module 中实现
*/
public interface BpmProcessEventListener extends Ordered {
public interface BpmnProcessEventListener extends Ordered {
/**
* 流程实例创建成功后回调

View File

@ -10,7 +10,7 @@ import org.springframework.core.Ordered;
*
* @author shao_hua
*/
public interface BpmTaskEventListener extends Ordered {
public interface BpmnTaskEventListener extends Ordered {
/**
* 用户任务已创建,未指派审核人

View File

@ -2,7 +2,7 @@ package cn.axzo.workflow.core.repository.mapper;
import cn.axzo.workflow.common.model.request.BpmPageParam;
import cn.axzo.workflow.common.model.response.BpmPageResult;
import cn.axzo.workflow.core.common.utils.BpmMyBatisUtils;
import cn.axzo.workflow.core.common.utils.BpmnMyBatisUtils;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -16,7 +16,7 @@ import java.util.List;
public interface BaseMapperX<T> extends BaseMapper<T> {
default BpmPageResult<T> selectPage(BpmPageParam pageParam, @Param("ew") Wrapper<T> queryWrapper) {
IPage<T> mpPage = BpmMyBatisUtils.buildPage(pageParam);
IPage<T> mpPage = BpmnMyBatisUtils.buildPage(pageParam);
this.selectPage(mpPage, queryWrapper);
return new BpmPageResult(mpPage.getRecords(), mpPage.getTotal());
}

View File

@ -1,85 +0,0 @@
package cn.axzo.workflow.core.repository.mapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ArrayUtils;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import org.springframework.util.StringUtils;
import java.util.Collection;
public class BpmLambdaQueryWrapperX<T> extends LambdaQueryWrapper <T> {
public BpmLambdaQueryWrapperX() {
}
public BpmLambdaQueryWrapperX<T> likeIfPresent(SFunction<T, ?> column, String val) {
return StringUtils.hasText(val) ? (BpmLambdaQueryWrapperX)super.like(column, val) : this;
}
public BpmLambdaQueryWrapperX<T> inIfPresent(SFunction<T, ?> column, Collection<?> values) {
return !CollectionUtils.isEmpty(values) ? (BpmLambdaQueryWrapperX)super.in(column, values) : this;
}
public BpmLambdaQueryWrapperX<T> inIfPresent(SFunction<T, ?> column, Object... values) {
return !ArrayUtils.isEmpty(values) ? (BpmLambdaQueryWrapperX)super.in(column, values) : this;
}
public BpmLambdaQueryWrapperX<T> eqIfPresent(SFunction<T, ?> column, Object val) {
return val != null ? (BpmLambdaQueryWrapperX)super.eq(column, val) : this;
}
public BpmLambdaQueryWrapperX<T> neIfPresent(SFunction<T, ?> column, Object val) {
return val != null ? (BpmLambdaQueryWrapperX)super.ne(column, val) : this;
}
public BpmLambdaQueryWrapperX<T> gtIfPresent(SFunction<T, ?> column, Object val) {
return val != null ? (BpmLambdaQueryWrapperX)super.gt(column, val) : this;
}
public BpmLambdaQueryWrapperX<T> geIfPresent(SFunction<T, ?> column, Object val) {
return val != null ? (BpmLambdaQueryWrapperX)super.ge(column, val) : this;
}
public BpmLambdaQueryWrapperX<T> ltIfPresent(SFunction<T, ?> column, Object val) {
return val != null ? (BpmLambdaQueryWrapperX)super.lt(column, val) : this;
}
public BpmLambdaQueryWrapperX<T> leIfPresent(SFunction<T, ?> column, Object val) {
return val != null ? (BpmLambdaQueryWrapperX)super.le(column, val) : this;
}
public BpmLambdaQueryWrapperX<T> betweenIfPresent(SFunction<T, ?> column, Object val1, Object val2) {
if (val1 != null && val2 != null) {
return (BpmLambdaQueryWrapperX)super.between(column, val1, val2);
} else if (val1 != null) {
return (BpmLambdaQueryWrapperX)this.ge(column, val1);
} else {
return val2 != null ? (BpmLambdaQueryWrapperX)this.le(column, val2) : this;
}
}
public BpmLambdaQueryWrapperX<T> eq(boolean condition, SFunction<T, ?> column, Object val) {
super.eq(condition, column, val);
return this;
}
public BpmLambdaQueryWrapperX<T> eq(SFunction<T, ?> column, Object val) {
super.eq(column, val);
return this;
}
public BpmLambdaQueryWrapperX<T> orderByDesc(SFunction<T, ?> column) {
super.orderByDesc(true, column);
return this;
}
public BpmLambdaQueryWrapperX<T> last(String lastSql) {
super.last(lastSql);
return this;
}
public BpmLambdaQueryWrapperX<T> in(SFunction<T, ?> column, Collection<?> coll) {
super.in(column, coll);
return this;
}
}

View File

@ -0,0 +1,85 @@
package cn.axzo.workflow.core.repository.mapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ArrayUtils;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import org.springframework.util.StringUtils;
import java.util.Collection;
public class BpmnLambdaQueryWrapperX<T> extends LambdaQueryWrapper<T> {
public BpmnLambdaQueryWrapperX() {
}
public BpmnLambdaQueryWrapperX<T> likeIfPresent(SFunction<T, ?> column, String val) {
return StringUtils.hasText(val) ? (BpmnLambdaQueryWrapperX) super.like(column, val) : this;
}
public BpmnLambdaQueryWrapperX<T> inIfPresent(SFunction<T, ?> column, Collection<?> values) {
return !CollectionUtils.isEmpty(values) ? (BpmnLambdaQueryWrapperX) super.in(column, values) : this;
}
public BpmnLambdaQueryWrapperX<T> inIfPresent(SFunction<T, ?> column, Object... values) {
return !ArrayUtils.isEmpty(values) ? (BpmnLambdaQueryWrapperX) super.in(column, values) : this;
}
public BpmnLambdaQueryWrapperX<T> eqIfPresent(SFunction<T, ?> column, Object val) {
return val != null ? (BpmnLambdaQueryWrapperX) super.eq(column, val) : this;
}
public BpmnLambdaQueryWrapperX<T> neIfPresent(SFunction<T, ?> column, Object val) {
return val != null ? (BpmnLambdaQueryWrapperX) super.ne(column, val) : this;
}
public BpmnLambdaQueryWrapperX<T> gtIfPresent(SFunction<T, ?> column, Object val) {
return val != null ? (BpmnLambdaQueryWrapperX) super.gt(column, val) : this;
}
public BpmnLambdaQueryWrapperX<T> geIfPresent(SFunction<T, ?> column, Object val) {
return val != null ? (BpmnLambdaQueryWrapperX) super.ge(column, val) : this;
}
public BpmnLambdaQueryWrapperX<T> ltIfPresent(SFunction<T, ?> column, Object val) {
return val != null ? (BpmnLambdaQueryWrapperX) super.lt(column, val) : this;
}
public BpmnLambdaQueryWrapperX<T> leIfPresent(SFunction<T, ?> column, Object val) {
return val != null ? (BpmnLambdaQueryWrapperX) super.le(column, val) : this;
}
public BpmnLambdaQueryWrapperX<T> betweenIfPresent(SFunction<T, ?> column, Object val1, Object val2) {
if (val1 != null && val2 != null) {
return (BpmnLambdaQueryWrapperX) super.between(column, val1, val2);
} else if (val1 != null) {
return (BpmnLambdaQueryWrapperX) this.ge(column, val1);
} else {
return val2 != null ? (BpmnLambdaQueryWrapperX) this.le(column, val2) : this;
}
}
public BpmnLambdaQueryWrapperX<T> eq(boolean condition, SFunction<T, ?> column, Object val) {
super.eq(condition, column, val);
return this;
}
public BpmnLambdaQueryWrapperX<T> eq(SFunction<T, ?> column, Object val) {
super.eq(column, val);
return this;
}
public BpmnLambdaQueryWrapperX<T> orderByDesc(SFunction<T, ?> column) {
super.orderByDesc(true, column);
return this;
}
public BpmnLambdaQueryWrapperX<T> last(String lastSql) {
super.last(lastSql);
return this;
}
public BpmnLambdaQueryWrapperX<T> in(SFunction<T, ?> column, Collection<?> coll) {
super.in(column, coll);
return this;
}
}

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.core.service.converter;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum;
import cn.axzo.workflow.common.model.response.bpmn.task.BpmnTaskDonePageItemVO;
import cn.axzo.workflow.common.model.response.bpmn.task.BpmnTaskTodoPageItemVO;
import org.flowable.engine.history.HistoricProcessInstance;
@ -9,7 +9,12 @@ import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import org.springframework.beans.BeanUtils;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import static cn.axzo.workflow.core.service.converter.BpmnHistoricTaskInstanceConverter.DELETE_REASON_END;
import static org.mapstruct.NullValueCheckStrategy.ALWAYS;
@ -59,7 +64,7 @@ public interface BpmnTaskDonePageItemConverter extends EntityConverter<BpmnTaskD
vo.setStartUserId(instance.getStartUserId());
vo.setStartTime(instance.getStartTime());
vo.setProcessInstanceEndTime(instance.getEndTime());
vo.setResult(BpmProcessInstanceResultEnum.valueOfStatus(instance.getBusinessStatus()));
vo.setResult(BpmnProcessInstanceResultEnum.valueOfStatus(instance.getBusinessStatus()));
vos.add(vo);
}
}

View File

@ -22,12 +22,23 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import static cn.axzo.workflow.common.constant.BpmConstants.BPMN_FILE_SUFFIX;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.*;
import static cn.axzo.workflow.core.common.utils.BpmCollectionUtils.addIfNotNull;
import static cn.axzo.workflow.core.common.utils.BpmCollectionUtils.convertMap;
import static cn.axzo.workflow.common.constant.BpmnConstants.BPMN_FILE_SUFFIX;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.BPMN_BYTES_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.MODEL_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.PROCESS_DEFINITION_DEPLOY_ID_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.PROCESS_DEFINITION_ID_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.PROCESS_DEFINITION_KEY_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.PROCESS_DEFINITION_KEY_NOT_MATCH;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.PROCESS_DEFINITION_NAME_NOT_MATCH;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.PROCESS_DEFINITION_RESULT_TOO_MANY;
import static cn.axzo.workflow.core.common.utils.BpmnCollectionUtils.addIfNotNull;
import static cn.axzo.workflow.core.common.utils.BpmnCollectionUtils.convertMap;
import static java.util.Collections.emptyList;
@Service

View File

@ -1,7 +1,7 @@
package cn.axzo.workflow.core.service.impl;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.common.enums.BpmnFlowNodeMode;
import cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum;
import cn.axzo.workflow.common.model.request.bpmn.process.BpmnProcessInstanceCancelDTO;
import cn.axzo.workflow.common.model.request.bpmn.process.BpmnProcessInstanceCreateDTO;
import cn.axzo.workflow.common.model.request.bpmn.process.BpmnProcessInstanceCreateWithFormDTO;
@ -17,7 +17,7 @@ import cn.axzo.workflow.common.model.response.bpmn.process.HistoricProcessInstan
import cn.axzo.workflow.common.model.response.bpmn.process.ProcessNodeDetailVO;
import cn.axzo.workflow.core.common.enums.BpmnProcessTaskResultEnum;
import cn.axzo.workflow.core.common.exception.WorkflowEngineException;
import cn.axzo.workflow.core.common.utils.BpmCollectionUtils;
import cn.axzo.workflow.core.common.utils.BpmnCollectionUtils;
import cn.axzo.workflow.core.service.BpmnProcessDefinitionService;
import cn.axzo.workflow.core.service.BpmnProcessInstanceService;
import cn.axzo.workflow.core.service.converter.BpmnHistoricProcessInstanceConverter;
@ -64,25 +64,25 @@ import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import static cn.axzo.workflow.common.constant.BpmConstants.AND_SIGN_EXPRESSION;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_DELETE_PROCESS_FLAG;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_END_TENANT_ID;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_END_USER_ID;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_END_USER_NAME;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_INITIATOR;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_PROCESS_TYPE_CANCEL;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_SPECIFY_NEXT_APPROVER;
import static cn.axzo.workflow.common.constant.BpmnConstants.AND_SIGN_EXPRESSION;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_DELETE_PROCESS_FLAG;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_END_TENANT_ID;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_END_USER_ID;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_END_USER_NAME;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_INITIATOR;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_PROCESS_TYPE_CANCEL;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_SPECIFY_NEXT_APPROVER;
import static cn.axzo.workflow.common.enums.BpmnFlowNodeMode.AND;
import static cn.axzo.workflow.common.enums.BpmnFlowNodeMode.OR;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.PROCESS_DEFINITION_ID_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.PROCESS_DEFINITION_IS_SUSPENDED;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.PROCESS_DEFINITION_KEY_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.PROCESS_INSTANCE_CANCELLED;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.PROCESS_INSTANCE_CANCEL_FAIL_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.PROCESS_INSTANCE_CANCEL_FAIL_NOT_SELF;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.PROCESS_INSTANCE_ID_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.PROCESS_INSTANCE_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.PROCESS_OPERATION_PARAM_VALID_ERROR;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.PROCESS_DEFINITION_ID_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.PROCESS_DEFINITION_IS_SUSPENDED;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.PROCESS_DEFINITION_KEY_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.PROCESS_INSTANCE_CANCELLED;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.PROCESS_INSTANCE_CANCEL_FAIL_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.PROCESS_INSTANCE_CANCEL_FAIL_NOT_SELF;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.PROCESS_INSTANCE_ID_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.PROCESS_INSTANCE_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.PROCESS_OPERATION_PARAM_VALID_ERROR;
import static cn.axzo.workflow.core.common.utils.BpmnNativeQueryUtil.countSql;
import static cn.axzo.workflow.core.common.utils.BpmnNativeQueryUtil.sqlConnectors;
@ -297,7 +297,7 @@ public class BpmnProcessInstanceServiceImpl implements BpmnProcessInstanceServic
if (!Objects.equals(instance.getStartUserId(), dto.getInitiator().buildAssigneeId())) {
throw new WorkflowEngineException(PROCESS_INSTANCE_CANCEL_FAIL_NOT_SELF);
}
if (Objects.nonNull(instance.getEndTime()) && Objects.equals(BpmProcessInstanceResultEnum.CANCELLED.getStatus(), instance.getBusinessStatus())) {
if (Objects.nonNull(instance.getEndTime()) && Objects.equals(BpmnProcessInstanceResultEnum.CANCELLED.getStatus(), instance.getBusinessStatus())) {
throw new WorkflowEngineException(PROCESS_INSTANCE_CANCELLED);
}
@ -374,7 +374,7 @@ public class BpmnProcessInstanceServiceImpl implements BpmnProcessInstanceServic
* @return 流程实例列表 Map
*/
public Map<String, ProcessInstance> getProcessInstanceMap(Set<String> ids) {
return BpmCollectionUtils.convertMap(getProcessInstances(ids),
return BpmnCollectionUtils.convertMap(getProcessInstances(ids),
ProcessInstance::getProcessInstanceId);
}
@ -386,7 +386,7 @@ public class BpmnProcessInstanceServiceImpl implements BpmnProcessInstanceServic
* @return 历史的流程实例列表 Map
*/
public Map<String, HistoricProcessInstance> getHistoricProcessInstanceMap(Set<String> ids) {
return BpmCollectionUtils.convertMap(getHistoricProcessInstances(ids),
return BpmnCollectionUtils.convertMap(getHistoricProcessInstances(ids),
HistoricProcessInstance::getId);
}

View File

@ -41,11 +41,11 @@ import java.util.Objects;
import static cn.axzo.workflow.common.constant.MetaInfoConstants.MODEL_DESCRIPTION;
import static cn.axzo.workflow.common.constant.MetaInfoConstants.MODEL_TYPE;
import static cn.axzo.workflow.common.constant.MetaInfoConstants.MODEL_TYPE_PROCESS;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.MODEL_ID_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.MODEL_KEY_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.MODEL_KEY_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.MODEL_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.PROCESS_DEFINITION_BPMN_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.MODEL_ID_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.MODEL_KEY_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.MODEL_KEY_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.MODEL_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.PROCESS_DEFINITION_BPMN_NOT_EXISTS;
import static cn.axzo.workflow.core.common.utils.BpmnNativeQueryUtil.countSql;
import static cn.axzo.workflow.core.common.utils.BpmnNativeQueryUtil.sqlConnectors;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.core.service.impl;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskAssigneeDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskAttachmentDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskAuditDTO;
@ -65,27 +65,27 @@ import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
import static cn.axzo.workflow.common.constant.BpmConstants.APPROVAL_ENDS_AUTOMATICALLY;
import static cn.axzo.workflow.common.constant.BpmConstants.COMMENT_TYPE_ADVICE;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_DELETE_PROCESS_FLAG;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_END_TENANT_ID;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_END_USER_ID;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_END_USER_NAME;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_PROCESS_TYPE_REJECT;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_SPECIFY_NEXT_APPROVER;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_TASK_RELATION_ASSIGNEE_INFO_SNAPSHOT;
import static cn.axzo.workflow.common.constant.BpmConstants.MULTI_INSTANCE_LOOP_COUNTER;
import static cn.axzo.workflow.common.constant.BpmConstants.NUMBER_OF_INSTANCES;
import static cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum.APPROVED;
import static cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum.CANCELLED;
import static cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum.PROCESSING;
import static cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum.REJECTED;
import static cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum.valueOfStatus;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.PROCESS_INSTANCE_ID_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.PROCESS_INSTANCE_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.TASK_COMPLETE_FAIL_ASSIGN_NOT_SELF;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.TASK_COMPLETE_FAIL_NOT_EXISTS;
import static cn.axzo.workflow.core.common.utils.BpmCollectionUtils.convertSet;
import static cn.axzo.workflow.common.constant.BpmnConstants.APPROVAL_ENDS_AUTOMATICALLY;
import static cn.axzo.workflow.common.constant.BpmnConstants.COMMENT_TYPE_ADVICE;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_DELETE_PROCESS_FLAG;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_END_TENANT_ID;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_END_USER_ID;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_END_USER_NAME;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_PROCESS_TYPE_REJECT;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_SPECIFY_NEXT_APPROVER;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_INFO_SNAPSHOT;
import static cn.axzo.workflow.common.constant.BpmnConstants.MULTI_INSTANCE_LOOP_COUNTER;
import static cn.axzo.workflow.common.constant.BpmnConstants.NUMBER_OF_INSTANCES;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.APPROVED;
import static cn.axzo.workflow.common.enums.BpmnProcessInstanceResultEnum.CANCELLED;
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.core.common.enums.BpmnErrorCode.PROCESS_INSTANCE_ID_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.PROCESS_INSTANCE_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.TASK_COMPLETE_FAIL_ASSIGN_NOT_SELF;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.TASK_COMPLETE_FAIL_NOT_EXISTS;
import static cn.axzo.workflow.core.common.utils.BpmnCollectionUtils.convertSet;
import static cn.axzo.workflow.core.common.utils.BpmnNativeQueryUtil.countSql;
import static cn.axzo.workflow.core.common.utils.BpmnNativeQueryUtil.sqlConnectors;
import static org.flowable.engine.impl.persistence.entity.CommentEntity.TYPE_COMMENT;
@ -396,11 +396,13 @@ public class BpmnTaskServiceImpl implements BpmnTaskService {
.stream().collect(Collectors.groupingBy(Comment::getTaskId));
Map<String, HistoricVariableInstance> variableInstanceMap =
historyService.createHistoricVariableInstanceQuery().processInstanceId(processInstanceId).list().stream().collect(Collectors.toMap(HistoricVariableInstance::getVariableName, Function.identity(), (s, t) -> s));
historyService.createHistoricVariableInstanceQuery().processInstanceId(processInstanceId).list()
.stream().collect(Collectors.toMap(HistoricVariableInstance::getVariableName,
Function.identity(), (s, t) -> s));
Set<String> taskDefinitionKeys = new HashSet<>();
int count = 0;
BpmProcessInstanceResultEnum finalBusinessStatus = valueOfStatus(instance.getBusinessStatus());
BpmnProcessInstanceResultEnum finalBusinessStatus = valueOfStatus(instance.getBusinessStatus());
for (BpmnHistoricTaskInstanceVO vo : vos) {
if (count == 0 || taskDefinitionKeys.contains(vo.getTaskDefinitionKey())) {
vo.setResult(finalBusinessStatus);

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.core.service.impl;
import cn.axzo.workflow.common.constant.BpmConstants;
import cn.axzo.workflow.common.constant.BpmnConstants;
import cn.axzo.workflow.common.model.request.category.CategoryCreateDTO;
import cn.axzo.workflow.common.model.request.category.CategorySearchDTO;
import cn.axzo.workflow.common.model.request.category.CategoryUpdateDTO;
@ -25,14 +25,14 @@ import java.util.Objects;
import java.util.Optional;
import java.util.stream.Collectors;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.CATEGORY_ID_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.CATEGORY_VALUE_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.CATEGORY_ID_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.CATEGORY_VALUE_EXISTS;
@Service
@RequiredArgsConstructor
@Slf4j
public class CategoryServiceImpl extends ServiceImpl<ExtAxDictMapper, ExtAxDictDO> implements CategoryService
, BpmConstants {
, BpmnConstants {
@Resource
private ExtAxDictMapper bpmDictDataMapper;

View File

@ -18,7 +18,10 @@ import javax.annotation.Nullable;
import javax.annotation.Resource;
import java.util.Objects;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.*;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.FORM_DEFINITION_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.FORM_DEFINITION_PARSER_ERROR;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.FORM_MODEL_ID_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.FORM_MODEL_NOT_EXISTS;
/**
* 表单定义 Service 实现

View File

@ -17,8 +17,8 @@ import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.Objects;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.TASK_COMPLETE_FAIL_ASSIGN_NOT_SELF;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.TASK_COMPLETE_FAIL_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.TASK_COMPLETE_FAIL_ASSIGN_NOT_SELF;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.TASK_COMPLETE_FAIL_NOT_EXISTS;
/**
* 表单实例 Service 实现

View File

@ -28,10 +28,10 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import static cn.axzo.workflow.common.constant.BpmConstants.FORM_FILE_SUFFIX;
import static cn.axzo.workflow.common.constant.BpmnConstants.FORM_FILE_SUFFIX;
import static cn.axzo.workflow.common.constant.MetaInfoConstants.MODEL_TYPE;
import static cn.axzo.workflow.common.constant.MetaInfoConstants.MODEL_TYPE_FORM;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.FORM_MODEL_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.FORM_MODEL_NOT_EXISTS;
import static cn.axzo.workflow.core.common.utils.BpmnNativeQueryUtil.countSql;
import static cn.axzo.workflow.core.common.utils.BpmnNativeQueryUtil.sqlConnectors;

View File

@ -11,7 +11,7 @@ import org.flowable.engine.impl.persistence.entity.ExecutionEntity;
import java.io.Serializable;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.ENGINE_EXECUTION_LOST_ID_ERROR;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.ENGINE_EXECUTION_LOST_ID_ERROR;
/**
* 流程定义内部的表达式评估命令器

View File

@ -25,7 +25,7 @@ import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.PROCESS_INSTANCE_NOT_EXISTS;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.PROCESS_INSTANCE_NOT_EXISTS;
/**
* 审批实例的运行节点预测/推断

View File

@ -1,8 +1,8 @@
package cn.axzo.workflow.server.controller.delegate;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import cn.axzo.workflow.core.deletage.BpmTaskCalculateDTO;
import cn.axzo.workflow.core.deletage.BpmTaskDelegate;
import cn.axzo.workflow.core.deletage.BpmnTaskCalculateDTO;
import cn.axzo.workflow.core.deletage.BpmnTaskDelegate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
@ -13,15 +13,15 @@ import java.util.List;
import java.util.Objects;
import java.util.Optional;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_SPECIFY_NEXT_APPROVER;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_SPECIFY_NEXT_APPROVER;
@Service
public class BpmnDefaultTaskDelegateImpl implements BpmTaskDelegate {
public class BpmnDefaultTaskDelegateImpl implements BpmnTaskDelegate {
private static final Logger log = LoggerFactory.getLogger(BpmnDefaultTaskDelegateImpl.class);
@Override
public List<BpmnTaskDelegateAssigner> calculateAssignerAtExecution(BpmTaskCalculateDTO delegateTask) {
public List<BpmnTaskDelegateAssigner> calculateAssignerAtExecution(BpmnTaskCalculateDTO delegateTask) {
// 这里的上层应该需要使用 Chain, 类似 Servlet 中的 Filter 模式,有一个有限策略, 例如此处的设置审批人, 第一个策略是优先获取上级直接指定
// 第二个策略是根据配置规则设置审批人.
// 而整体为了保证维护性和扩展性,需要内置整个链路有限策略,只要有一个策略已经有人了,则不再执行后续逻辑.

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.server.controller.listener;
import cn.axzo.workflow.core.listener.BpmActivityEventListener;
import cn.axzo.workflow.core.listener.BpmnActivityEventListener;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.api.delegate.event.FlowableEvent;
import org.flowable.engine.delegate.event.impl.FlowableActivityEventImpl;
@ -15,7 +15,7 @@ import org.flowable.engine.delegate.event.impl.FlowableActivityEventImpl;
*/
@Slf4j
//@Component
public class CustomBpmActivityEventListener implements BpmActivityEventListener {
public class CustomBpmActivityEventListener implements BpmnActivityEventListener {
@Override
public void onEvent(FlowableEvent event) {

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.server.controller.listener.process;
import cn.axzo.workflow.core.listener.BpmProcessEventListener;
import cn.axzo.workflow.core.listener.BpmnProcessEventListener;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;
@ -17,7 +17,7 @@ import org.flowable.engine.delegate.event.FlowableProcessStartedEvent;
*/
@Slf4j
//@Component
public class CustomBpmProcessEventListener implements BpmProcessEventListener {
public class CustomBpmnProcessEventListener implements BpmnProcessEventListener {
@Override
public void onCreated(FlowableEngineEntityEvent event) {
log.info("Process onCreated: ClassName: {}, event: {}", event.getClass().getName(), JSON.toJSONString(event));

View File

@ -5,7 +5,7 @@ import cn.axzo.framework.rocketmq.EventProducer;
import cn.axzo.workflow.common.enums.ProcessInstanceEventEnum;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import cn.axzo.workflow.common.model.response.mq.ProcessInstanceDTO;
import cn.axzo.workflow.core.listener.BpmProcessEventListener;
import cn.axzo.workflow.core.listener.BpmnProcessEventListener;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;
@ -19,7 +19,7 @@ import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_INITIATOR;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_INITIATOR;
import static cn.axzo.workflow.common.enums.ProcessInstanceEventEnum.PROCESS_INSTANCE_CANCELLED;
import static cn.axzo.workflow.common.enums.ProcessInstanceEventEnum.PROCESS_INSTANCE_COMPLETED;
import static cn.axzo.workflow.common.enums.ProcessInstanceEventEnum.PROCESS_INSTANCE_CREATED;
@ -35,7 +35,7 @@ import static cn.axzo.workflow.common.enums.ProcessInstanceEventEnum.PROCESS_INS
*/
@Slf4j
@Component
public class RocketMqBpmProcessEventListener implements BpmProcessEventListener {
public class RocketMqBpmnProcessEventListener implements BpmnProcessEventListener {
@Resource
private EventProducer<?> eventProducer;

View File

@ -5,7 +5,7 @@ import cn.axzo.framework.rocketmq.EventProducer;
import cn.axzo.workflow.common.enums.ProcessTaskEventEnum;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import cn.axzo.workflow.common.model.response.mq.ProcessTaskDTO;
import cn.axzo.workflow.core.listener.BpmTaskEventListener;
import cn.axzo.workflow.core.listener.BpmnTaskEventListener;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.RepositoryService;
import org.flowable.engine.RuntimeService;
@ -16,8 +16,8 @@ import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_INITIATOR;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_TASK_RELATION_ASSIGNEE_INFO_SNAPSHOT;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_INITIATOR;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_INFO_SNAPSHOT;
import static cn.axzo.workflow.common.enums.ProcessTaskEventEnum.PROCESS_TASK_ASSIGNED;
import static cn.axzo.workflow.common.enums.ProcessTaskEventEnum.PROCESS_TASK_COMPLETED;
import static cn.axzo.workflow.common.enums.ProcessTaskEventEnum.PROCESS_TASK_CREATED;
@ -32,7 +32,7 @@ import static cn.axzo.workflow.common.enums.ProcessTaskEventEnum.PROCESS_TASK_DE
*/
@Slf4j
@Component
public class RocketMqBpmTaskEventListener implements BpmTaskEventListener {
public class RocketMqBpmnTaskEventListener implements BpmnTaskEventListener {
@Resource
private EventProducer<?> eventProducer;

View File

@ -1,7 +1,7 @@
package cn.axzo.workflow.server.controller.listener.task;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import cn.axzo.workflow.core.listener.BpmTaskEventListener;
import cn.axzo.workflow.core.listener.BpmnTaskEventListener;
import lombok.extern.slf4j.Slf4j;
import org.flowable.task.service.delegate.DelegateTask;
import org.springframework.stereotype.Component;
@ -10,8 +10,8 @@ import org.springframework.util.CollectionUtils;
import java.util.List;
import java.util.Objects;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_TASK_RELATION_ASSIGNEE_INFO_SNAPSHOT;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_INFO_SNAPSHOT;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_LIST_INFO_SNAPSHOT;
/**
* 任务节点关联的处理人快照保持
@ -23,7 +23,7 @@ import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_TASK_RELATI
*/
@Slf4j
@Component
public class SnapshotBpmTaskTaskEventListener implements BpmTaskEventListener {
public class SnapshotBpmnTaskTaskEventListener implements BpmnTaskEventListener {
@Override
public void onAssigned(DelegateTask delegateTask) {

View File

@ -1,7 +1,7 @@
package cn.axzo.workflow.server.controller.listener.task;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import cn.axzo.workflow.core.listener.BpmTaskEventListener;
import cn.axzo.workflow.core.listener.BpmnTaskEventListener;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.RuntimeService;
@ -12,9 +12,9 @@ import org.springframework.util.StringUtils;
import java.util.Objects;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_INITIATOR;
import static cn.axzo.workflow.common.constant.BpmConstants.INTERNAL_TASK_RELATION_ASSIGNEE_INFO_SNAPSHOT;
import static cn.axzo.workflow.common.enums.BpmFlowNodeType.NODE_STARTER;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_INITIATOR;
import static cn.axzo.workflow.common.constant.BpmnConstants.INTERNAL_TASK_RELATION_ASSIGNEE_INFO_SNAPSHOT;
import static cn.axzo.workflow.common.enums.BpmnFlowNodeType.NODE_STARTER;
/**
* 仿钉钉版本的 发起人 节点自动通过处理
@ -25,7 +25,7 @@ import static cn.axzo.workflow.common.enums.BpmFlowNodeType.NODE_STARTER;
@Slf4j
@Component
@AllArgsConstructor
public class StartNodeAutoCompleteEventListener implements BpmTaskEventListener {
public class StartNodeAutoCompleteEventListener implements BpmnTaskEventListener {
private final TaskService taskService;
private final RuntimeService runtimeService;

View File

@ -36,7 +36,7 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.PROCESS_OPERATION_PARAM_VALID_ERROR;
import static cn.axzo.workflow.core.common.enums.BpmnErrorCode.PROCESS_OPERATION_PARAM_VALID_ERROR;
import static cn.azxo.framework.common.model.CommonResponse.success;
@Slf4j