BPM:增加任务监听器、执行监听器的管理

This commit is contained in:
YunaiV 2024-03-23 19:23:11 +08:00
parent 889b9406b8
commit 6d44bf0d7a
5 changed files with 12 additions and 4 deletions

View File

@ -1,6 +1,8 @@
package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.listener; package cn.iocoder.yudao.module.bpm.controller.admin.definition.vo.listener;
import cn.iocoder.yudao.framework.common.enums.CommonStatusEnum;
import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.validation.InEnum;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -21,4 +23,8 @@ public class BpmProcessListenerPageReqVO extends PageParam {
@Schema(description = "监听事件", example = "start") @Schema(description = "监听事件", example = "start")
private String event; private String event;
@Schema(description = "状态", example = "1")
@InEnum(CommonStatusEnum.class)
private Integer status;
} }

View File

@ -20,6 +20,7 @@ public interface BpmProcessListenerMapper extends BaseMapperX<BpmProcessListener
.likeIfPresent(BpmProcessListenerDO::getName, reqVO.getName()) .likeIfPresent(BpmProcessListenerDO::getName, reqVO.getName())
.eqIfPresent(BpmProcessListenerDO::getType, reqVO.getType()) .eqIfPresent(BpmProcessListenerDO::getType, reqVO.getType())
.eqIfPresent(BpmProcessListenerDO::getEvent, reqVO.getEvent()) .eqIfPresent(BpmProcessListenerDO::getEvent, reqVO.getEvent())
.eqIfPresent(BpmProcessListenerDO::getStatus, reqVO.getStatus())
.orderByDesc(BpmProcessListenerDO::getId)); .orderByDesc(BpmProcessListenerDO::getId));
} }

View File

@ -12,7 +12,7 @@ import org.springframework.stereotype.Component;
*/ */
@Component @Component
@Slf4j @Slf4j
public class DemoDelegateClassExecutionListener implements TaskListener { public class DemoDelegateClassTaskListener implements TaskListener {
@Override @Override
public void notify(DelegateTask delegateTask) { public void notify(DelegateTask delegateTask) {

View File

@ -3,14 +3,16 @@ package cn.iocoder.yudao.module.bpm.framework.flowable.core.listener.demo.task;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.delegate.TaskListener; import org.flowable.engine.delegate.TaskListener;
import org.flowable.task.service.delegate.DelegateTask; import org.flowable.task.service.delegate.DelegateTask;
import org.springframework.stereotype.Component;
/** /**
* 类型为 delegateExpression TaskListener 监听器示例 * 类型为 delegateExpression TaskListener 监听器示例
* *
* @author 芋道源码 * @author 芋道源码
*/ */
@Component
@Slf4j @Slf4j
public class DemoDelegateExpressionExecutionListener implements TaskListener { public class DemoDelegateExpressionTaskListener implements TaskListener {
@Override @Override
public void notify(DelegateTask delegateTask) { public void notify(DelegateTask delegateTask) {

View File

@ -1,7 +1,6 @@
package cn.iocoder.yudao.module.bpm.framework.flowable.core.listener.demo.task; package cn.iocoder.yudao.module.bpm.framework.flowable.core.listener.demo.task;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.delegate.TaskListener;
import org.flowable.task.service.delegate.DelegateTask; import org.flowable.task.service.delegate.DelegateTask;
/** /**
@ -10,7 +9,7 @@ import org.flowable.task.service.delegate.DelegateTask;
* @author 芋道源码 * @author 芋道源码
*/ */
@Slf4j @Slf4j
public class DemoSpringExpressionExecutionListener { public class DemoSpringExpressionTaskListener {
public void notify(DelegateTask delegateTask) { public void notify(DelegateTask delegateTask) {
log.info("[execute][task({}) 被调用]", delegateTask.getId()); log.info("[execute][task({}) 被调用]", delegateTask.getId());