update - 新增一个 module, 移动普通的模型至独立的模块中

This commit is contained in:
wangli 2023-09-25 20:30:08 +08:00
parent 54e9669b3c
commit d67f2a3083
123 changed files with 2608 additions and 396 deletions

View File

@ -45,6 +45,11 @@
<artifactId>workflow-engine-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>workflow-engine-common</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>workflow-engine-core</artifactId>
@ -95,8 +100,10 @@
</repository>
</repositories>
<modules>
<module>workflow-engine-core</module>
<module>workflow-engine-api</module>
<module>workflow-engine-common</module>
<module>workflow-engine-core</module>
<module>workflow-engine-server</module>
</modules>
</project>

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
@ -22,27 +23,10 @@
<artifactId>axzo-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
<scope>provided</scope>
</dependency>
<!-- lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<groupId>${project.groupId}</groupId>
<artifactId>workflow-engine-common</artifactId>
<version>${project.version}</version>
</dependency>
<!-- for test -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

View File

@ -1,9 +1,9 @@
package cn.axzo.workflow.client.feign.bpmn;
import cn.axzo.workflow.client.model.request.bpmn.definition.BpmnProcessDefinitionUpdateDTO;
import cn.axzo.workflow.client.model.request.bpmn.process.BpmnProcessDefinitionPageDTO;
import cn.axzo.workflow.client.model.response.BpmPageResult;
import cn.axzo.workflow.client.model.response.bpmn.process.BpmnProcessDefinitionVO;
import cn.axzo.workflow.common.model.request.bpmn.definition.BpmnProcessDefinitionUpdateDTO;
import cn.axzo.workflow.common.model.request.bpmn.process.BpmnProcessDefinitionPageDTO;
import cn.axzo.workflow.common.model.response.BpmPageResult;
import cn.axzo.workflow.common.model.response.bpmn.process.BpmnProcessDefinitionVO;
import cn.azxo.framework.common.model.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;

View File

@ -1,9 +1,9 @@
package cn.axzo.workflow.client.feign.bpmn;
import cn.axzo.workflow.client.model.request.bpmn.process.*;
import cn.axzo.workflow.client.model.response.BpmPageResult;
import cn.axzo.workflow.client.model.response.bpmn.process.BpmnProcessInstancePageItemVO;
import cn.axzo.workflow.client.model.response.bpmn.process.BpmnProcessInstanceVO;
import cn.axzo.workflow.common.model.request.bpmn.process.*;
import cn.axzo.workflow.common.model.response.BpmPageResult;
import cn.axzo.workflow.common.model.response.bpmn.process.BpmnProcessInstancePageItemVO;
import cn.axzo.workflow.common.model.response.bpmn.process.BpmnProcessInstanceVO;
import cn.azxo.framework.common.model.CommonResponse;
import com.fasterxml.jackson.databind.node.ObjectNode;
import io.swagger.v3.oas.annotations.Operation;
@ -15,7 +15,7 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
/**
* TODO
* 流程实例
*
* @author wangli
* @since 2023/9/21 16:26
@ -39,7 +39,7 @@ public interface ProcessInstanceApi {
CommonResponse<String> createProcessInstanceWith(@Validated @RequestBody BpmnProcessInstanceCreateWithFormDTO dto);
@DeleteMapping("/cancel")
CommonResponse<Boolean> cancelProcessInstant(@Validated @RequestBody BpmnProcessInstanceCancelDTO dto);
CommonResponse<Boolean> cancelProcessInstance(@Validated @RequestBody BpmnProcessInstanceCancelDTO dto);
/**
* 获得流程实例

View File

@ -1,11 +1,11 @@
package cn.axzo.workflow.client.feign.bpmn;
import cn.axzo.workflow.client.model.request.bpmn.model.BpmnModelCreateDTO;
import cn.axzo.workflow.client.model.request.bpmn.model.BpmnModelSearchDTO;
import cn.axzo.workflow.client.model.request.bpmn.model.BpmnModelUpdateDTO;
import cn.axzo.workflow.client.model.response.BpmPageResult;
import cn.axzo.workflow.client.model.response.bpmn.model.BpmnModelDetailVO;
import cn.axzo.workflow.client.model.response.form.model.FormModelBaseVO;
import cn.axzo.workflow.common.model.request.bpmn.model.BpmnModelCreateDTO;
import cn.axzo.workflow.common.model.request.bpmn.model.BpmnModelSearchDTO;
import cn.axzo.workflow.common.model.request.bpmn.model.BpmnModelUpdateDTO;
import cn.axzo.workflow.common.model.response.BpmPageResult;
import cn.axzo.workflow.common.model.response.bpmn.model.BpmnModelDetailVO;
import cn.axzo.workflow.common.model.response.form.model.FormModelBaseVO;
import cn.azxo.framework.common.model.CommonResponse;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;

View File

@ -1,10 +1,10 @@
package cn.axzo.workflow.client.feign.bpmn;
import cn.axzo.workflow.client.model.request.bpmn.task.BpmnTaskAssigneeDTO;
import cn.axzo.workflow.client.model.request.bpmn.task.BpmnTaskAuditDTO;
import cn.axzo.workflow.client.model.request.bpmn.task.BpmnTaskPageSearchDTO;
import cn.axzo.workflow.client.model.response.BpmPageResult;
import cn.axzo.workflow.client.model.response.bpmn.task.*;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskAssigneeDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskAuditDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskPageSearchDTO;
import cn.axzo.workflow.common.model.response.BpmPageResult;
import cn.axzo.workflow.common.model.response.bpmn.task.*;
import cn.azxo.framework.common.model.CommonResponse;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>workflow-engine</artifactId>
<groupId>cn.axzo.workflow</groupId>
<version>${revision}</version>
</parent>
<artifactId>workflow-engine-common</artifactId>
<packaging>jar</packaging>
<name>workflow-engine-common</name>
<dependencies>
<dependency>
<groupId>cn.axzo.framework</groupId>
<artifactId>axzo-spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>cn.axzo.framework.rocketmq</groupId>
<artifactId>axzo-common-rocketmq</artifactId>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<!-- lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.core.common;
package cn.axzo.workflow.common.constant;
public interface BpmConstants {
@ -22,6 +22,7 @@ public interface BpmConstants {
String INTERNAL_DELETE_PROCESS_FLAG = "_INTERNAL_DELETE_PROCESS_FLAG";
String INTERNAL_PROCESS_TYPE_CANCEL = "_INTERNAL_PROCESS_TYPE_CANCEL";
String INTERNAL_PROCESS_TYPE_REJECT = "_INTERNAL_PROCESS_TYPE_REJECT";
String INTERNAL_SPECIFY_NEXT_APPROVER = "_INTERNAL_SPECIFY_NEXT_APPROVER";
String PROCESS_PREFIX = "Flowable";
String START_EVENT_ID = "startEventNode";

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.enums;
package cn.axzo.workflow.common.enums;
public enum BpmFlowMultiMode {

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.enums;
package cn.axzo.workflow.common.enums;
public enum BpmFlowNodeType {

View File

@ -0,0 +1,49 @@
package cn.axzo.workflow.common.enums;
import cn.axzo.framework.rocketmq.Event;
/**
* 流程实例相关的 MQ 事件枚举定义
*
* @author wangli
* @since 2023/9/25 11:47
*/
public enum ProcessInstanceEventEnum {
PROCESS_INSTANCE_CREATED("process-instance", "process-instance-created", "流程实例已创建"),
PROCESS_INSTANCE_STARTED("process-instance", "process-instance-started", "流程实例已开始"),
PROCESS_INSTANCE_CANCELLED("process-instance", "process-instance-cancelled", "流程实例已取消"),
PROCESS_INSTANCE_REJECTED("process-instance", "process-instance-rejected", "流程实例已拒绝"),
PROCESS_INSTANCE_COMPLETED("process-instance", "process-instance-completed", "流程实例已结束"),
;
private final String module;
private final String tag;
private final String desc;
private Event.EventCode eventCode;
ProcessInstanceEventEnum(String module, String tag, String desc) {
this.eventCode = Event.EventCode.builder()
.module(module)
.name(tag)
.build();
this.module = module;
this.tag = tag;
this.desc = desc;
}
public String getModule() {
return module;
}
public String getTag() {
return tag;
}
public String getDesc() {
return desc;
}
public Event.EventCode getEventCode() {
return eventCode;
}
}

View File

@ -0,0 +1,48 @@
package cn.axzo.workflow.common.enums;
import cn.axzo.framework.rocketmq.Event;
/**
* 流程任务节点相关的 MQ 事件枚举定义
*
* @author wangli
* @since 2023/9/25 16:09
*/
public enum ProcessTaskEventEnum {
PROCESS_TASK_CREATED("process-task", "process-task-created", "流程任务已创建"),
PROCESS_TASK_ASSIGNED("process-task", "process-task-assigned", "流程任务已分配"),
PROCESS_TASK_COMPLETED("process-task", "process-task-completed", "流程任务已结束"),
PROCESS_TASK_DELETED("process-task", "process-task-deleted", "流程任务已删除"),
;
private final String module;
private final String tag;
private final String desc;
private Event.EventCode eventCode;
ProcessTaskEventEnum(String model, String tag, String desc) {
this.eventCode = Event.EventCode.builder()
.module(model)
.name(tag)
.build();
this.module = model;
this.tag = tag;
this.desc = desc;
}
public String getModule() {
return module;
}
public String getTag() {
return tag;
}
public String getDesc() {
return desc;
}
public Event.EventCode getEventCode() {
return eventCode;
}
}

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.request;
package cn.axzo.workflow.common.model.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -1,8 +1,10 @@
package cn.axzo.workflow.client.model.request.bpmn;
package cn.axzo.workflow.common.model.request.bpmn;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.util.HashMap;
import java.util.List;
@ -10,22 +12,25 @@ import java.util.Map;
/**
* JSON 版本的 BPMN 协议模型
* @author wangli
*/
@ApiModel("JSON 版本的 BPMN 协议模型")
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class BpmnJsonNode {
@ApiModelProperty(value = "节点ID", required = true)
@ApiModelProperty(value = "节点ID")
private String id;
@ApiModelProperty(value = "父节点ID", required = true)
@ApiModelProperty(value = "父节点ID")
private String parentId;
@ApiModelProperty(value = "节点类型 NODE_STARTER/NODE_TASK/NODE_ROUTER/NODE_CONDITION", required = true)
@ApiModelProperty(value = "节点类型 NODE_STARTER/NODE_TASK/NODE_ROUTER/NODE_CONDITION")
private String type;
@ApiModelProperty(value = "节点名称", required = true)
@ApiModelProperty(value = "节点名称")
private String name;
@ApiModelProperty(value = "子节点信息", required = true)
@ApiModelProperty(value = "子节点信息")
private BpmnJsonNode children;
@ApiModelProperty(value = "分支节点信息", required = true)
@ApiModelProperty(value = "分支节点信息")
private List<BpmnJsonNode> branches;
private BpmnJsonNodeProperty property;
@ -33,10 +38,6 @@ public class BpmnJsonNode {
/* 内部使用,不需要外界传 */
private transient Map incoming = new HashMap();
public BpmnJsonNode() {
}
public String getId() {
return id;
}

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.client.model.request.bpmn;
package cn.axzo.workflow.common.model.request.bpmn;
import cn.axzo.workflow.client.enums.BpmFlowMultiMode;
import cn.axzo.workflow.common.enums.BpmFlowMultiMode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.client.model.request.bpmn.definition;
package cn.axzo.workflow.common.model.request.bpmn.definition;
import cn.axzo.workflow.client.model.request.bpmn.BpmnJsonNode;
import cn.axzo.workflow.common.model.request.bpmn.BpmnJsonNode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.client.model.request.bpmn.model;
package cn.axzo.workflow.common.model.request.bpmn.model;
import cn.axzo.workflow.client.model.request.bpmn.BpmnJsonNode;
import cn.axzo.workflow.common.model.request.bpmn.BpmnJsonNode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.client.model.request.bpmn.model;
package cn.axzo.workflow.common.model.request.bpmn.model;
import cn.axzo.workflow.client.model.request.BpmPageParam;
import cn.axzo.workflow.common.model.request.BpmPageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.request.bpmn.model;
package cn.axzo.workflow.common.model.request.bpmn.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.request.bpmn.process;
package cn.axzo.workflow.common.model.request.bpmn.process;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.client.model.request.bpmn.process;
package cn.axzo.workflow.common.model.request.bpmn.process;
import cn.axzo.workflow.client.model.request.BpmPageParam;
import cn.axzo.workflow.common.model.request.BpmPageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.request.bpmn.process;
package cn.axzo.workflow.common.model.request.bpmn.process;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -24,8 +24,11 @@ public class BpmnProcessInstanceCancelDTO {
/**
* 流程实例对应的 businessKey
*
* modify: businessKey 不是唯一的, flowable 允许 businessKey 想同,暂时不能通过该属性进行取消流程实例
*/
@ApiModelProperty(value = "流程实例的 businessKey", example = "businessKey", notes = "与 id 必须二选一")
@ApiModelProperty(value = "流程实例的 businessKey", example = "businessKey", notes = "与 id 必须二选一", hidden = true)
@Deprecated
private String businessKey;
/**

View File

@ -1,5 +1,6 @@
package cn.axzo.workflow.client.model.request.bpmn.process;
package cn.axzo.workflow.common.model.request.bpmn.process;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -25,8 +26,9 @@ public class BpmnProcessInstanceCreateDTO {
*/
@NotEmpty(message = "流程定义的标识不能为空")
private String processDefinitionKey;
/**
* 变量实例
* 流程实例关联的变量
*/
private Map<String, Object> variables = new HashMap<>();
@ -45,7 +47,9 @@ public class BpmnProcessInstanceCreateDTO {
private String tenantId;
/**
* 发起人的身份ID
* 发起人的标识
* (安心筑:identityId + identityType)
* (枢智:普通的用户唯一键)
*/
@ApiModelProperty(value = "操作人标识")
@NotBlank(message = "用户Id不能为空")
@ -63,4 +67,9 @@ public class BpmnProcessInstanceCreateDTO {
@ApiModelProperty(value = "自定义的流程实例名称")
private String customProcessInstanceName;
/**
* 下级审批人
*/
@ApiModelProperty(value = "下级审批人", notes = "可为空,定义选择审批人,如果不为空,则覆盖下一级任务的审核人")
private BpmnTaskDelegateAssigner nextApprover;
}

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.request.bpmn.process;
package cn.axzo.workflow.common.model.request.bpmn.process;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -1,7 +1,7 @@
package cn.axzo.workflow.client.model.request.bpmn.process;
package cn.axzo.workflow.common.model.request.bpmn.process;
import cn.axzo.workflow.client.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.client.model.request.BpmPageParam;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.common.model.request.BpmPageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.request.bpmn.process;
package cn.axzo.workflow.common.model.request.bpmn.process;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.client.model.request.bpmn.process;
package cn.axzo.workflow.common.model.request.bpmn.process;
import cn.axzo.workflow.client.model.request.BpmPageParam;
import cn.axzo.workflow.common.model.request.BpmPageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.request.bpmn.task;
package cn.axzo.workflow.common.model.request.bpmn.task;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.request.bpmn.task;
package cn.axzo.workflow.common.model.request.bpmn.task;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -9,6 +9,7 @@ import javax.validation.constraints.NotEmpty;
/**
* 审批任务节点的入参模型
* @author wangli
*/
@ApiModel("审批任务节点的入参模型")
@Data
@ -17,6 +18,7 @@ public class BpmnTaskAuditDTO {
@ApiModelProperty(value = "任务编号", required = true, example = "1024")
@NotEmpty(message = "任务编号不能为空")
private String taskId;
/**
* 审核人Id
*/
@ -44,4 +46,14 @@ public class BpmnTaskAuditDTO {
@ApiModelProperty(value = "审批意见")
private String advice;
/**
* 审核人信息
*/
private BpmnTaskDelegateAssigner approver;
/**
* 下级审批人
*/
@ApiModelProperty(value = "下级审批人", notes = "可为空,定义选择审批人,如果不为空,则覆盖下一级任务的审核人")
private BpmnTaskDelegateAssigner nextApprover;
}

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.request.bpmn.task;
package cn.axzo.workflow.common.model.request.bpmn.task;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -0,0 +1,46 @@
package cn.axzo.workflow.common.model.request.bpmn.task;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* @author wangli
*/
@Data
@Accessors(chain = true)
public class BpmnTaskDelegateAssigner implements Serializable {
private static final long serialVersionUID = -8106887960942113552L;
/**
* 审核人标识
* <p>
* 对应安心筑的身份 ID
*/
private String assignee;
/**
* 审核人标识扩展信息
* <p>
* 对应安心筑的身份 Type
*/
private String assigneeType;
/**
* 审核人姓名
*/
private String assignerName;
/**
* 对应安心筑特殊的PersonId
*/
private String personId;
/**
* 所属租户, 对应安心筑的 workspaceId
*/
private String tenantId;
}

View File

@ -1,7 +1,7 @@
package cn.axzo.workflow.client.model.request.bpmn.task;
package cn.axzo.workflow.common.model.request.bpmn.task;
import cn.axzo.workflow.client.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.client.model.request.BpmPageParam;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.common.model.request.BpmPageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.request.category;
package cn.axzo.workflow.common.model.request.category;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.client.model.request.category;
package cn.axzo.workflow.common.model.request.category;
import cn.axzo.workflow.client.model.request.BpmPageParam;
import cn.axzo.workflow.common.model.request.BpmPageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.request.category;
package cn.axzo.workflow.common.model.request.category;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.request.form.definition;
package cn.axzo.workflow.common.model.request.form.definition;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.request.form.definition;
package cn.axzo.workflow.common.model.request.form.definition;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.request.form.definition;
package cn.axzo.workflow.common.model.request.form.definition;
import io.swagger.annotations.ApiModel;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.request.form.instance;
package cn.axzo.workflow.common.model.request.form.instance;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.request.form.model;
package cn.axzo.workflow.common.model.request.form.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.client.model.request.form.model;
package cn.axzo.workflow.common.model.request.form.model;
import cn.axzo.workflow.client.model.request.BpmPageParam;
import cn.axzo.workflow.common.model.request.BpmPageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.request.form.model;
package cn.axzo.workflow.common.model.request.form.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.response;
package cn.axzo.workflow.common.model.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.response.bpmn.model;
package cn.axzo.workflow.common.model.response.bpmn.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.client.model.response.bpmn.model;
package cn.axzo.workflow.common.model.response.bpmn.model;
import cn.axzo.workflow.client.model.request.bpmn.BpmnJsonNode;
import cn.axzo.workflow.common.model.request.bpmn.BpmnJsonNode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.response.bpmn.process;
package cn.axzo.workflow.common.model.response.bpmn.process;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.client.model.response.bpmn.process;
package cn.axzo.workflow.common.model.response.bpmn.process;
import cn.axzo.workflow.client.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,7 +1,7 @@
package cn.axzo.workflow.client.model.response.bpmn.process;
package cn.axzo.workflow.common.model.response.bpmn.process;
import cn.axzo.workflow.client.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.response.bpmn.process;
package cn.axzo.workflow.common.model.response.bpmn.process;
import io.swagger.annotations.ApiModel;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.response.bpmn.task;
package cn.axzo.workflow.common.model.response.bpmn.task;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.client.model.response.bpmn.task;
package cn.axzo.workflow.common.model.response.bpmn.task;
import cn.axzo.workflow.client.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.client.model.response.bpmn.task;
package cn.axzo.workflow.common.model.response.bpmn.task;
import cn.axzo.workflow.client.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.client.model.response.bpmn.task;
package cn.axzo.workflow.common.model.response.bpmn.task;
import cn.axzo.workflow.client.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.response.bpmn.task;
package cn.axzo.workflow.common.model.response.bpmn.task;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.response.bpmn.task;
package cn.axzo.workflow.common.model.response.bpmn.task;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.response.category;
package cn.axzo.workflow.common.model.response.category;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.client.model.response.form.definition;
package cn.axzo.workflow.common.model.response.form.definition;
import cn.axzo.workflow.client.model.request.form.definition.FormFieldsDTO;
import cn.axzo.workflow.common.model.request.form.definition.FormFieldsDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

View File

@ -1,4 +1,4 @@
package cn.axzo.workflow.client.model.response.form.model;
package cn.axzo.workflow.common.model.response.form.model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

View File

@ -0,0 +1,91 @@
package cn.axzo.workflow.common.model.response.mq;
import cn.axzo.workflow.common.enums.ProcessInstanceEventEnum;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
import java.util.Map;
/**
* 用于 MQ 传输数据
*
* @author wangli
* @since 2023/9/25 14:06
*/
@Data
@Accessors(chain = true)
public class ProcessInstanceDTO implements Serializable {
/**
* 流程实例相关 MQ 事件的数据类型
*/
private ProcessInstanceEventEnum type;
/**
* 流程实例所属业务分类
*/
private String category;
/**
* 流程实例 ID
*/
private String processInstanceId;
/**
* 流程定义中审批节点 key, 可用于业务识别唯一的审批节点
*/
private String currentElementKey;
/**
* 流程实例使用的定义 ID
*/
private String processDefinitionId;
/**
* 流程定义的 key
*/
private String processDefinitionKey;
/**
* 流程定义的 version
*/
private Integer processDefinitionVersion;
/**
* 流程实例关联的流程变量
*/
private Map<String, Object> variables;
/**
* 流程实例创建时间
*/
private Date startTime;
/**
* 流程实例所属租户
*/
private String tenantId;
/**
* 业务创建流程实例时,传入的业务关键信息
*/
private String businessKey;
/**
* 业务创建流程时,传入的自定义流程实例名称
*/
private String businessProcessInstanceName;
/**
* 发起人信息
*/
private BpmnTaskDelegateAssigner initiator;
/**
* 取消流程实例的特殊字段
*/
private String cancelReason;
}

View File

@ -0,0 +1,76 @@
package cn.axzo.workflow.common.model.response.mq;
import cn.axzo.workflow.common.enums.ProcessTaskEventEnum;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
import java.util.Map;
/**
* 流程实例任务
*
* @author wangli
* @since 2023/9/25 16:08
*/
@Data
@Accessors(chain = true)
public class ProcessTaskDTO implements Serializable {
/**
* 流程任务相关 MQ 事件的数据类型
*/
private ProcessTaskEventEnum type;
/**
* 流程实例所属业务分类
*/
private String category;
/**
* 流程任务 ID
*/
private String processTaskId;
/**
* 流程实例 ID
*/
private String processInstanceId;
/**
* 流程定义中节点 key, 可用于业务识别唯一的审批节点
*/
private String currentElementKey;
/**
* 流程定义中节点名称
*/
private String currentElementName;
/**
* 流程实例使用的定义 ID
*/
private String processDefinitionId;
/**
* 流程实例关联的流程变量
*/
private Map<String, Object> variables;
/**
* 流程实例创建时间
*/
private Date startTime;
/**
* 流程实例所属租户
*/
private String tenantId;
/**
* 审批人信息
*/
private BpmnTaskDelegateAssigner approver;
}

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.core.common.utils;
import cn.axzo.workflow.client.model.request.BpmPageParam;
import cn.axzo.workflow.common.model.request.BpmPageParam;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;

View File

@ -1,9 +1,9 @@
package cn.axzo.workflow.core.common.utils;
import cn.axzo.workflow.client.enums.BpmFlowMultiMode;
import cn.axzo.workflow.client.enums.BpmFlowNodeType;
import cn.axzo.workflow.client.model.request.bpmn.BpmnJsonNode;
import cn.axzo.workflow.client.model.request.bpmn.BpmnJsonNodeProperty;
import cn.axzo.workflow.common.enums.BpmFlowMultiMode;
import cn.axzo.workflow.common.enums.BpmFlowNodeType;
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;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
@ -20,8 +20,8 @@ import java.lang.reflect.InvocationTargetException;
import java.util.*;
import java.util.stream.Collectors;
import static cn.axzo.workflow.core.common.BpmConstants.BPM_ALLOW_SKIP_USER_TASK;
import static cn.axzo.workflow.core.common.BpmConstants.END_EVENT_ID;
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.core.common.enums.BpmErrorCode.CONVERTOR_META_DATA_FORMAT_ERROR;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.CONVERTOR_UNKNOW_NODE_TYPE;
import static org.flowable.bpmn.model.ImplementationType.IMPLEMENTATION_TYPE_DELEGATEEXPRESSION;

View File

@ -27,8 +27,8 @@ public class RocketMqEventConfiguration {
@Value("${spring.profiles.active:dev}")
private String activeProfile;
private static final String DEFAULT_MODULE = "flowable";
private static final String DEFAULT_EVENT = "flowable-default-event-";
private static final String DEFAULT_MODULE = "workflowEngine";
private static final String DEFAULT_EVENT = "topic_workflow_engine_";
@Bean
EventProducer eventProducer(RocketMQTemplate rocketMQTemplate) {

View File

@ -1,7 +1,10 @@
package cn.axzo.workflow.core.deletage;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import java.util.List;
public interface BpmTaskDelegate {
List<BpmTaskDelegateAssigner> calculateAssignerAtExecution(BpmTaskCalculateDTO delegateTask);
List<BpmnTaskDelegateAssigner> calculateAssignerAtExecution(BpmTaskCalculateDTO delegateTask);
}

View File

@ -1,16 +0,0 @@
package cn.axzo.workflow.core.deletage;
import lombok.Data;
@Data
public class BpmTaskDelegateAssigner {
/**
* 审核人Id
* */
private String assignerId;
/**
* 审核人姓名
* */
private String assignerName;
}

View File

@ -2,6 +2,7 @@ package cn.axzo.workflow.core.listener;
import org.flowable.common.engine.api.delegate.event.FlowableEvent;
import org.flowable.engine.delegate.event.impl.FlowableActivityEventImpl;
import org.springframework.core.Ordered;
/**
* 用户审批任务节点完成事件
@ -9,7 +10,7 @@ import org.flowable.engine.delegate.event.impl.FlowableActivityEventImpl;
* @author wangli
* @since 2023/7/24 17:27
*/
public interface BpmActivityEventListener {
public interface BpmActivityEventListener extends Ordered {
/**
* 由于Flowable BPMN Engine 没有直接对 UserTask 直接做相关事件,

View File

@ -3,11 +3,12 @@ package cn.axzo.workflow.core.listener;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;
import org.flowable.engine.delegate.event.FlowableCancelledEvent;
import org.flowable.engine.delegate.event.FlowableProcessStartedEvent;
import org.springframework.core.Ordered;
/**
* 流程实例相关事件
*/
public interface BpmProcessEventListener {
public interface BpmProcessEventListener extends Ordered {
/**
* 流程实例创建成功后回调

View File

@ -1,11 +1,12 @@
package cn.axzo.workflow.core.listener;
import org.flowable.task.service.delegate.DelegateTask;
import org.springframework.core.Ordered;
/**
* @author shao_hua
*/
public interface BpmTaskEventListener {
public interface BpmTaskEventListener extends Ordered {
/**
* 用户任务已创建,未指派审核人

View File

@ -1,7 +1,7 @@
package cn.axzo.workflow.core.repository.mapper;
import cn.axzo.workflow.client.model.request.BpmPageParam;
import cn.axzo.workflow.client.model.response.BpmPageResult;
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 com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;

View File

@ -1,9 +1,9 @@
package cn.axzo.workflow.core.service;
import cn.axzo.workflow.client.model.request.bpmn.definition.BpmnProcessDefinitionUpdateDTO;
import cn.axzo.workflow.client.model.request.bpmn.process.BpmnProcessDefinitionPageDTO;
import cn.axzo.workflow.client.model.response.BpmPageResult;
import cn.axzo.workflow.client.model.response.bpmn.process.BpmnProcessDefinitionVO;
import cn.axzo.workflow.common.model.request.bpmn.definition.BpmnProcessDefinitionUpdateDTO;
import cn.axzo.workflow.common.model.request.bpmn.process.BpmnProcessDefinitionPageDTO;
import cn.axzo.workflow.common.model.response.BpmPageResult;
import cn.axzo.workflow.common.model.response.bpmn.process.BpmnProcessDefinitionVO;
import org.flowable.common.engine.impl.db.SuspensionState;
import org.flowable.engine.repository.Model;
import org.flowable.engine.repository.ProcessDefinition;

View File

@ -1,10 +1,10 @@
package cn.axzo.workflow.core.service;
import cn.axzo.workflow.client.model.request.bpmn.process.*;
import cn.axzo.workflow.client.model.response.BpmPageResult;
import cn.axzo.workflow.client.model.response.bpmn.process.BpmnProcessInstancePageItemVO;
import cn.axzo.workflow.client.model.response.bpmn.process.BpmnProcessInstanceVO;
import cn.axzo.workflow.client.model.response.bpmn.process.HistoricProcessInstanceVO;
import cn.axzo.workflow.common.model.request.bpmn.process.*;
import cn.axzo.workflow.common.model.response.BpmPageResult;
import cn.axzo.workflow.common.model.response.bpmn.process.BpmnProcessInstancePageItemVO;
import cn.axzo.workflow.common.model.response.bpmn.process.BpmnProcessInstanceVO;
import cn.axzo.workflow.common.model.response.bpmn.process.HistoricProcessInstanceVO;
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.flowable.engine.history.HistoricProcessInstance;
import org.flowable.form.api.FormInfo;

View File

@ -1,11 +1,11 @@
package cn.axzo.workflow.core.service;
import cn.axzo.workflow.client.model.request.bpmn.model.BpmnModelCreateDTO;
import cn.axzo.workflow.client.model.request.bpmn.model.BpmnModelSearchDTO;
import cn.axzo.workflow.client.model.request.bpmn.model.BpmnModelUpdateDTO;
import cn.axzo.workflow.client.model.response.BpmPageResult;
import cn.axzo.workflow.client.model.response.bpmn.model.BpmnModelDetailVO;
import cn.axzo.workflow.client.model.response.form.model.FormModelBaseVO;
import cn.axzo.workflow.common.model.request.bpmn.model.BpmnModelCreateDTO;
import cn.axzo.workflow.common.model.request.bpmn.model.BpmnModelSearchDTO;
import cn.axzo.workflow.common.model.request.bpmn.model.BpmnModelUpdateDTO;
import cn.axzo.workflow.common.model.response.BpmPageResult;
import cn.axzo.workflow.common.model.response.bpmn.model.BpmnModelDetailVO;
import cn.axzo.workflow.common.model.response.form.model.FormModelBaseVO;
import io.swagger.annotations.ApiOperation;
import javax.annotation.Nullable;

View File

@ -1,11 +1,11 @@
package cn.axzo.workflow.core.service;
import cn.axzo.workflow.client.model.request.bpmn.task.BpmnTaskAssigneeDTO;
import cn.axzo.workflow.client.model.request.bpmn.task.BpmnTaskAuditDTO;
import cn.axzo.workflow.client.model.request.bpmn.task.BpmnTaskCommentDTO;
import cn.axzo.workflow.client.model.request.bpmn.task.BpmnTaskPageSearchDTO;
import cn.axzo.workflow.client.model.response.BpmPageResult;
import cn.axzo.workflow.client.model.response.bpmn.task.*;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskAssigneeDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskAuditDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskCommentDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskPageSearchDTO;
import cn.axzo.workflow.common.model.response.BpmPageResult;
import cn.axzo.workflow.common.model.response.bpmn.task.*;
import org.flowable.form.api.FormInfo;
import java.util.List;

View File

@ -1,10 +1,10 @@
package cn.axzo.workflow.core.service;
import cn.axzo.workflow.client.model.request.category.CategoryCreateDTO;
import cn.axzo.workflow.client.model.request.category.CategorySearchDTO;
import cn.axzo.workflow.client.model.request.category.CategoryUpdateDTO;
import cn.axzo.workflow.client.model.response.category.CategoryItemVO;
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;
import cn.axzo.workflow.common.model.response.category.CategoryItemVO;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
/**

View File

@ -1,8 +1,8 @@
package cn.axzo.workflow.core.service;
import cn.axzo.workflow.client.model.request.form.definition.FormDefinitionUpdateDTO;
import cn.axzo.workflow.client.model.response.form.definition.FormDefinitionVO;
import cn.axzo.workflow.common.model.request.form.definition.FormDefinitionUpdateDTO;
import cn.axzo.workflow.common.model.response.form.definition.FormDefinitionVO;
import javax.annotation.Nullable;

View File

@ -1,7 +1,7 @@
package cn.axzo.workflow.core.service;
import cn.axzo.workflow.client.model.request.form.instance.FormContentUpdateDTO;
import cn.axzo.workflow.common.model.request.form.instance.FormContentUpdateDTO;
/**
* 表单实例相关接口

View File

@ -1,11 +1,11 @@
package cn.axzo.workflow.core.service;
import cn.axzo.workflow.client.model.request.bpmn.model.BpmnModelSearchDTO;
import cn.axzo.workflow.client.model.request.form.model.FormModelCreateDTO;
import cn.axzo.workflow.client.model.request.form.model.FormModelUpdateDTO;
import cn.axzo.workflow.client.model.response.BpmPageResult;
import cn.axzo.workflow.client.model.response.form.model.FormModelBaseVO;
import cn.axzo.workflow.common.model.request.bpmn.model.BpmnModelSearchDTO;
import cn.axzo.workflow.common.model.request.form.model.FormModelCreateDTO;
import cn.axzo.workflow.common.model.request.form.model.FormModelUpdateDTO;
import cn.axzo.workflow.common.model.response.BpmPageResult;
import cn.axzo.workflow.common.model.response.form.model.FormModelBaseVO;
import javax.annotation.Nullable;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.core.service.converter;
import cn.axzo.workflow.client.model.response.bpmn.task.BpmnHistoricCommentVO;
import cn.axzo.workflow.common.model.response.bpmn.task.BpmnHistoricCommentVO;
import org.flowable.engine.task.Comment;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.core.service.converter;
import cn.axzo.workflow.client.model.response.bpmn.process.HistoricProcessInstanceVO;
import cn.axzo.workflow.common.model.response.bpmn.process.HistoricProcessInstanceVO;
import org.flowable.engine.history.HistoricProcessInstance;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.core.service.converter;
import cn.axzo.workflow.client.model.response.bpmn.task.BpmnHistoricTaskInstanceVO;
import cn.axzo.workflow.common.model.response.bpmn.task.BpmnHistoricTaskInstanceVO;
import org.flowable.engine.impl.bpmn.behavior.MultiInstanceActivityBehavior;
import org.flowable.task.api.history.HistoricTaskInstance;
import org.mapstruct.Mapper;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.core.service.converter;
import cn.axzo.workflow.client.model.response.bpmn.model.BpmnModelDetailVO;
import cn.axzo.workflow.common.model.response.bpmn.model.BpmnModelDetailVO;
import org.flowable.engine.repository.Model;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.core.service.converter;
import cn.axzo.workflow.client.model.response.bpmn.process.BpmnProcessDefinitionVO;
import cn.axzo.workflow.common.model.response.bpmn.process.BpmnProcessDefinitionVO;
import org.flowable.engine.impl.persistence.entity.ProcessDefinitionEntity;
import org.flowable.engine.repository.ProcessDefinition;
import org.mapstruct.Mapper;

View File

@ -1,7 +1,7 @@
package cn.axzo.workflow.core.service.converter;
import cn.axzo.workflow.client.model.response.bpmn.process.BpmnProcessDefinitionVO;
import cn.axzo.workflow.client.model.response.bpmn.process.BpmnProcessInstanceVO;
import cn.axzo.workflow.common.model.response.bpmn.process.BpmnProcessDefinitionVO;
import cn.axzo.workflow.common.model.response.bpmn.process.BpmnProcessInstanceVO;
import org.flowable.engine.history.HistoricProcessInstance;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.core.service.converter;
import cn.axzo.workflow.client.model.response.bpmn.process.BpmnProcessInstancePageItemVO;
import cn.axzo.workflow.common.model.response.bpmn.process.BpmnProcessInstancePageItemVO;
import org.flowable.engine.history.HistoricProcessInstance;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.core.service.converter;
import cn.axzo.workflow.client.model.response.bpmn.task.BpmnTaskInstanceVO;
import cn.axzo.workflow.common.model.response.bpmn.task.BpmnTaskInstanceVO;
import org.flowable.task.api.Task;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

View File

@ -1,8 +1,8 @@
package cn.axzo.workflow.core.service.converter;
import cn.axzo.workflow.client.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.client.model.response.bpmn.task.BpmnTaskDonePageItemVO;
import cn.axzo.workflow.client.model.response.bpmn.task.BpmnTaskTodoPageItemVO;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
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;
import org.flowable.task.api.history.HistoricTaskInstance;
import org.mapstruct.Mapper;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.core.service.converter;
import cn.axzo.workflow.client.model.response.bpmn.task.BpmnTaskTodoPageItemVO;
import cn.axzo.workflow.common.model.response.bpmn.task.BpmnTaskTodoPageItemVO;
import org.flowable.engine.runtime.ProcessInstance;
import org.flowable.task.api.history.HistoricTaskInstance;
import org.mapstruct.Mapper;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.core.service.converter;
import cn.axzo.workflow.client.model.response.category.CategoryItemVO;
import cn.axzo.workflow.common.model.response.category.CategoryItemVO;
import cn.axzo.workflow.core.repository.entity.ExtAxDictDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

View File

@ -1,6 +1,6 @@
package cn.axzo.workflow.core.service.converter;
import cn.axzo.workflow.client.model.response.form.model.FormModelBaseVO;
import cn.axzo.workflow.common.model.response.form.model.FormModelBaseVO;
import org.flowable.engine.repository.Model;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

View File

@ -1,7 +1,9 @@
package cn.axzo.workflow.core.service.engine;
import cn.axzo.framework.jackson.utility.JSON;
import cn.axzo.workflow.core.listener.BpmActivityEventListener;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.api.delegate.event.AbstractFlowableEventListener;
import org.flowable.common.engine.api.delegate.event.FlowableEvent;
import org.flowable.common.engine.api.delegate.event.FlowableEventType;
@ -9,7 +11,9 @@ import org.springframework.beans.factory.ObjectProvider;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import static org.flowable.common.engine.api.delegate.event.FlowableEngineEventType.*;
@ -19,11 +23,12 @@ import static org.flowable.common.engine.api.delegate.event.FlowableEngineEventT
* @author wangli
* @since 2023/7/24 17:36
*/
@Slf4j
@Component
public class EngineActivityEventListener extends AbstractFlowableEventListener {
@Resource
private ObjectProvider<BpmActivityEventListener> listener;
ObjectProvider<List<BpmActivityEventListener>> activityListeners;
@Override
public Collection<? extends FlowableEventType> getTypes() {
@ -34,11 +39,20 @@ public class EngineActivityEventListener extends AbstractFlowableEventListener {
@Override
public void onEvent(FlowableEvent event) {
listener.ifAvailable(i -> i.onEvent(event));
getOrderedListeners().forEach(i -> i.onEvent(event));
}
@Override
public boolean isFailOnException() {
return false;
}
private List<BpmActivityEventListener> getOrderedListeners() {
List<BpmActivityEventListener> orderListeners = new ArrayList<>();
activityListeners.ifAvailable(orderListeners::addAll);
if (log.isDebugEnabled()) {
log.debug("Order Lists: {}", JSON.toJSONString(orderListeners));
}
return orderListeners;
}
}

View File

@ -1,9 +1,9 @@
package cn.axzo.workflow.core.service.engine;
import cn.axzo.workflow.core.common.BpmConstants;
import cn.axzo.workflow.common.constant.BpmConstants;
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.BpmTaskDelegateAssigner;
import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.flowable.bpmn.model.Process;
@ -20,7 +20,8 @@ import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import static cn.axzo.workflow.core.common.BpmConstants.BPM_ALLOW_SKIP_USER_TASK;
import static cn.axzo.workflow.common.constant.BpmConstants.BPM_ALLOW_SKIP_USER_TASK;
/**
* 在这里设置审批人
@ -55,11 +56,11 @@ public class EngineExecutionStartListener implements ExecutionListener {
bpmTaskDelegate.ifAvailable(delegate -> {
List<BpmTaskDelegateAssigner> assigners = delegate.calculateAssignerAtExecution(calculateDTO);
List<BpmnTaskDelegateAssigner> assigners = delegate.calculateAssignerAtExecution(calculateDTO);
List<String> assigneeIdList = new ArrayList<>();
if (!CollectionUtils.isEmpty(assigners)) {
for (BpmTaskDelegateAssigner user : assigners) {
assigneeIdList.add(user.getAssignerId());
for (BpmnTaskDelegateAssigner user : assigners) {
assigneeIdList.add(user.getAssignee());
}
if (!userTask.hasMultiInstanceLoopCharacteristics()) {

View File

@ -1,6 +1,7 @@
package cn.axzo.workflow.core.service.engine;
import cn.axzo.workflow.client.enums.BpmProcessInstanceResultEnum;
import cn.axzo.framework.jackson.utility.JSON;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.core.listener.BpmProcessEventListener;
import com.google.common.collect.ImmutableSet;
import lombok.extern.slf4j.Slf4j;
@ -16,17 +17,21 @@ import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Set;
import static cn.axzo.workflow.client.enums.BpmProcessInstanceResultEnum.CANCELLED;
import static cn.axzo.workflow.core.common.BpmConstants.*;
import static cn.axzo.workflow.common.constant.BpmConstants.*;
import static cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum.CANCELLED;
@Slf4j
@Component
public class EngineProcessInstanceEventListener extends AbstractFlowableEngineEventListener {
@Resource
ObjectProvider<BpmProcessEventListener> processEventListener;
ObjectProvider<List<BpmProcessEventListener>> processEventListeners;
@Resource
@Lazy
private RuntimeService runtimeService;
@ -44,21 +49,21 @@ public class EngineProcessInstanceEventListener extends AbstractFlowableEngineEv
@Override
protected void processCreated(FlowableEngineEntityEvent event) {
processEventListener.ifAvailable(listener -> listener.onCreated(event));
getOrderedListeners().forEach(i -> i.onCreated(event));
}
@Override
protected void processStarted(FlowableProcessStartedEvent event) {
runtimeService.updateBusinessStatus(((FlowableProcessStartedEventImpl) event).getProcessInstanceId(),
BpmProcessInstanceResultEnum.PROCESSING.getStatus());
processEventListener.ifAvailable(listener -> listener.onStarted(event));
getOrderedListeners().forEach(i -> i.onStarted(event));
}
@Override
protected void processCompleted(FlowableEngineEntityEvent event) {
runtimeService.updateBusinessStatus(event.getProcessInstanceId(),
BpmProcessInstanceResultEnum.APPROVED.getStatus());
processEventListener.ifAvailable(listener -> listener.onCompleted(event));
getOrderedListeners().forEach(i -> i.onCompleted(event));
}
@Override
@ -79,14 +84,22 @@ public class EngineProcessInstanceEventListener extends AbstractFlowableEngineEv
throw new IllegalArgumentException("这里是不允许执行到的地方, 请关注程序逻辑");
}
runtimeService.updateBusinessStatus(event.getProcessInstanceId(), resultEnum.getStatus());
processEventListener.ifAvailable(listener -> {
getOrderedListeners().forEach(i -> {
if (Objects.equals(resultEnum, CANCELLED)) {
listener.onCancelled(event);
i.onCancelled(event);
} else {
listener.onRejected(event);
i.onRejected(event);
}
});
}
private List<BpmProcessEventListener> getOrderedListeners() {
List<BpmProcessEventListener> orderListeners = new ArrayList<>();
processEventListeners.ifAvailable(orderListeners::addAll);
if (log.isDebugEnabled()) {
log.debug("Order Lists: {}", JSON.toJSONString(orderListeners));
}
return orderListeners;
}
}

View File

@ -1,22 +1,28 @@
package cn.axzo.workflow.core.service.engine;
import cn.axzo.framework.jackson.utility.JSON;
import cn.axzo.workflow.core.deletage.BpmTaskDelegate;
import cn.axzo.workflow.core.listener.BpmTaskEventListener;
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.delegate.TaskListener;
import org.flowable.task.service.delegate.DelegateTask;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Component
/**
* @author wangli
*/
@Slf4j
@Component
public class EngineTaskEventListener implements TaskListener {
@Resource
@Lazy
BpmTaskEventListener taskEventListener;
ObjectProvider<List<BpmTaskEventListener>> taskEventListeners;
@Resource
@Lazy
@ -24,25 +30,36 @@ public class EngineTaskEventListener implements TaskListener {
@Override
public void notify(DelegateTask delegateTask) {
log.info("Task.notify {} taskDelegate:{}", delegateTask.getId(),taskDelegate);
log.info("Task.notify {} taskDelegate:{}", delegateTask.getId(), taskDelegate);
switch (delegateTask.getEventName()) {
case TaskListener.EVENTNAME_CREATE:
taskEventListener.created(delegateTask);
break;
case TaskListener.EVENTNAME_ASSIGNMENT:
taskEventListener.assigned(delegateTask);
break;
case TaskListener.EVENTNAME_COMPLETE:
//审批完成
taskEventListener.completed(delegateTask);
break;
case TaskListener.EVENTNAME_DELETE:
// 审批删除
taskEventListener.deleted(delegateTask);
break;
getOrderedListeners().forEach(i -> {
switch (delegateTask.getEventName()) {
case EVENTNAME_CREATE:
i.created(delegateTask);
break;
case EVENTNAME_ASSIGNMENT:
i.assigned(delegateTask);
break;
case EVENTNAME_COMPLETE:
//审批完成
i.completed(delegateTask);
break;
case EVENTNAME_DELETE:
// 审批删除
i.deleted(delegateTask);
break;
default:
}
}
});
}
private List<BpmTaskEventListener> getOrderedListeners() {
List<BpmTaskEventListener> orderListeners = new ArrayList<>();
taskEventListeners.ifAvailable(orderListeners::addAll);
if (log.isDebugEnabled()) {
log.debug("Order Lists: {}", JSON.toJSONString(orderListeners));
}
return orderListeners;
}
}

View File

@ -1,9 +1,9 @@
package cn.axzo.workflow.core.service.impl;
import cn.axzo.workflow.client.model.request.bpmn.definition.BpmnProcessDefinitionUpdateDTO;
import cn.axzo.workflow.client.model.request.bpmn.process.BpmnProcessDefinitionPageDTO;
import cn.axzo.workflow.client.model.response.BpmPageResult;
import cn.axzo.workflow.client.model.response.bpmn.process.BpmnProcessDefinitionVO;
import cn.axzo.workflow.common.model.request.bpmn.definition.BpmnProcessDefinitionUpdateDTO;
import cn.axzo.workflow.common.model.request.bpmn.process.BpmnProcessDefinitionPageDTO;
import cn.axzo.workflow.common.model.response.BpmPageResult;
import cn.axzo.workflow.common.model.response.bpmn.process.BpmnProcessDefinitionVO;
import cn.axzo.workflow.core.common.exception.WorkflowEngineException;
import cn.axzo.workflow.core.common.utils.BpmTransformUtil;
import cn.axzo.workflow.core.service.BpmnProcessDefinitionService;
@ -24,7 +24,7 @@ import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.*;
import static cn.axzo.workflow.core.common.BpmConstants.BPMN_FILE_SUFFIX;
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;

View File

@ -1,11 +1,12 @@
package cn.axzo.workflow.core.service.impl;
import cn.axzo.workflow.client.model.request.bpmn.process.*;
import cn.axzo.workflow.client.model.response.BpmPageResult;
import cn.axzo.workflow.client.model.response.bpmn.process.BpmnProcessDefinitionVO;
import cn.axzo.workflow.client.model.response.bpmn.process.BpmnProcessInstancePageItemVO;
import cn.axzo.workflow.client.model.response.bpmn.process.BpmnProcessInstanceVO;
import cn.axzo.workflow.client.model.response.bpmn.process.HistoricProcessInstanceVO;
import cn.axzo.workflow.common.model.request.bpmn.process.*;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskDelegateAssigner;
import cn.axzo.workflow.common.model.response.BpmPageResult;
import cn.axzo.workflow.common.model.response.bpmn.process.BpmnProcessDefinitionVO;
import cn.axzo.workflow.common.model.response.bpmn.process.BpmnProcessInstancePageItemVO;
import cn.axzo.workflow.common.model.response.bpmn.process.BpmnProcessInstanceVO;
import cn.axzo.workflow.common.model.response.bpmn.process.HistoricProcessInstanceVO;
import cn.axzo.workflow.core.common.enums.BpmnProcessTaskResultEnum;
import cn.axzo.workflow.core.common.exception.WorkflowEngineException;
import cn.axzo.workflow.core.common.utils.BpmCollectionUtils;
@ -44,7 +45,7 @@ import javax.validation.Valid;
import java.util.*;
import java.util.stream.Collectors;
import static cn.axzo.workflow.core.common.BpmConstants.*;
import static cn.axzo.workflow.common.constant.BpmConstants.*;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.*;
@Service
@ -189,6 +190,10 @@ public class BpmnProcessInstanceServiceImpl implements BpmnProcessInstanceServic
}
dto.getVariables().put(INTERNAL_START_USER_NAME, dto.getUserName());
dto.getVariables().put(INTERNAL_START_USER_ID, dto.getUserId());
BpmnTaskDelegateAssigner nextApprover = dto.getNextApprover();
nextApprover.setTenantId(StringUtils.isNotBlank(nextApprover.getTenantId()) ? nextApprover.getTenantId() :
dto.getTenantId());
dto.getVariables().put(INTERNAL_SPECIFY_NEXT_APPROVER, nextApprover);
// 创建流程实例
// 设置流程实例的开始人参考https://wenku.baidu.com/view/5538062e7a563c1ec5da50e2524de518964bd3f9.html

View File

@ -1,11 +1,11 @@
package cn.axzo.workflow.core.service.impl;
import cn.axzo.workflow.client.model.request.bpmn.model.BpmnModelCreateDTO;
import cn.axzo.workflow.client.model.request.bpmn.model.BpmnModelSearchDTO;
import cn.axzo.workflow.client.model.request.bpmn.model.BpmnModelUpdateDTO;
import cn.axzo.workflow.client.model.response.BpmPageResult;
import cn.axzo.workflow.client.model.response.bpmn.model.BpmnModelDetailVO;
import cn.axzo.workflow.client.model.response.form.model.FormModelBaseVO;
import cn.axzo.workflow.common.model.request.bpmn.model.BpmnModelCreateDTO;
import cn.axzo.workflow.common.model.request.bpmn.model.BpmnModelSearchDTO;
import cn.axzo.workflow.common.model.request.bpmn.model.BpmnModelUpdateDTO;
import cn.axzo.workflow.common.model.response.BpmPageResult;
import cn.axzo.workflow.common.model.response.bpmn.model.BpmnModelDetailVO;
import cn.axzo.workflow.common.model.response.form.model.FormModelBaseVO;
import cn.axzo.workflow.core.common.exception.WorkflowEngineException;
import cn.axzo.workflow.core.common.utils.BpmTransformUtil;
import cn.axzo.workflow.core.service.BpmnProcessDefinitionService;
@ -29,7 +29,7 @@ import javax.validation.Valid;
import java.util.List;
import java.util.Objects;
import static cn.axzo.workflow.core.common.BpmConstants.MODEL_META_INFO_PROCESS;
import static cn.axzo.workflow.common.constant.BpmConstants.MODEL_META_INFO_PROCESS;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.*;
import static cn.axzo.workflow.core.service.impl.FormModelServiceImpl.countSql;
import static cn.axzo.workflow.core.service.impl.FormModelServiceImpl.sqlConnectors;

View File

@ -1,12 +1,12 @@
package cn.axzo.workflow.core.service.impl;
import cn.axzo.workflow.client.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.client.model.request.bpmn.task.BpmnTaskAssigneeDTO;
import cn.axzo.workflow.client.model.request.bpmn.task.BpmnTaskAuditDTO;
import cn.axzo.workflow.client.model.request.bpmn.task.BpmnTaskCommentDTO;
import cn.axzo.workflow.client.model.request.bpmn.task.BpmnTaskPageSearchDTO;
import cn.axzo.workflow.client.model.response.BpmPageResult;
import cn.axzo.workflow.client.model.response.bpmn.task.*;
import cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskAssigneeDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskAuditDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskCommentDTO;
import cn.axzo.workflow.common.model.request.bpmn.task.BpmnTaskPageSearchDTO;
import cn.axzo.workflow.common.model.response.BpmPageResult;
import cn.axzo.workflow.common.model.response.bpmn.task.*;
import cn.axzo.workflow.core.common.exception.WorkflowEngineException;
import cn.axzo.workflow.core.service.BpmnTaskService;
import cn.axzo.workflow.core.service.converter.*;
@ -39,8 +39,8 @@ import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
import static cn.axzo.workflow.client.enums.BpmProcessInstanceResultEnum.*;
import static cn.axzo.workflow.core.common.BpmConstants.*;
import static cn.axzo.workflow.common.constant.BpmConstants.*;
import static cn.axzo.workflow.common.enums.BpmProcessInstanceResultEnum.*;
import static cn.axzo.workflow.core.common.enums.BpmErrorCode.*;
import static cn.axzo.workflow.core.common.utils.BpmCollectionUtils.convertSet;
import static cn.axzo.workflow.core.service.impl.BpmnProcessInstanceServiceImpl.countSql;

View File

@ -1,10 +1,10 @@
package cn.axzo.workflow.core.service.impl;
import cn.axzo.workflow.client.model.request.category.CategoryCreateDTO;
import cn.axzo.workflow.client.model.request.category.CategorySearchDTO;
import cn.axzo.workflow.client.model.request.category.CategoryUpdateDTO;
import cn.axzo.workflow.client.model.response.category.CategoryItemVO;
import cn.axzo.workflow.core.common.BpmConstants;
import cn.axzo.workflow.common.constant.BpmConstants;
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;
import cn.axzo.workflow.common.model.response.category.CategoryItemVO;
import cn.axzo.workflow.core.common.exception.WorkflowEngineException;
import cn.axzo.workflow.core.repository.entity.ExtAxDictDO;
import cn.axzo.workflow.core.repository.mapper.ExtAxDictMapper;

Some files were not shown because too many files have changed in this diff Show More