Merge branch 'feature/REQ-1609'

This commit is contained in:
wangli 2023-12-20 13:49:36 +08:00
commit 0d48bfcbf7
3 changed files with 18 additions and 4 deletions

View File

@ -49,4 +49,9 @@ public enum BpmnProcessInstanceResultEnum {
return Arrays.stream(values()).filter(it -> it.getStatus().equals(status)).findFirst() return Arrays.stream(values()).filter(it -> it.getStatus().equals(status)).findFirst()
.orElse(null); .orElse(null);
} }
public static BpmnProcessInstanceResultEnum valueOfDesc(String desc) {
return Arrays.stream(values()).filter(it -> it.getDesc().equals(desc)).findFirst()
.orElse(null);
}
} }

View File

@ -1,6 +1,10 @@
package cn.axzo.workflow.core.conf; package cn.axzo.workflow.core.conf;
import cn.axzo.framework.rocketmq.*; import cn.axzo.framework.rocketmq.DefaultEventConsumer;
import cn.axzo.framework.rocketmq.EventConsumer;
import cn.axzo.framework.rocketmq.EventHandlerRepository;
import cn.axzo.framework.rocketmq.EventProducer;
import cn.axzo.framework.rocketmq.RocketMQEventProducer;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.core.RocketMQTemplate; import org.apache.rocketmq.spring.core.RocketMQTemplate;
@ -9,6 +13,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import java.util.Objects;
import java.util.function.Consumer; import java.util.function.Consumer;
/** /**
@ -76,7 +81,11 @@ public class RocketMqEventConfiguration {
// } // }
@Bean @Bean
EventHandlerRepository eventHandlerRepository() { EventHandlerRepository eventHandlerRepository() {
return new EventHandlerRepository((ex, logText) -> return new EventHandlerRepository((ex, logText) -> {
log.warn("MQ, handle warning {} , Exception: {}", logText, JSON.toJSONString(ex))); log.warn("MQ, handle warning {} , Exception: {}", logText, JSON.toJSONString(ex));
if (Objects.nonNull(ex)) {
throw new RuntimeException(ex);
}
});
} }
} }

View File

@ -160,7 +160,7 @@ public class RocketMqMessagePushEventListener implements BpmnMessagePushEventLis
event.getNoticeConfig().getPending().getPendingMessageId(), JSON.toJSONString(event.getAssigner())); event.getNoticeConfig().getPending().getPendingMessageId(), JSON.toJSONString(event.getAssigner()));
} }
MessagePushDTO dto = build(event.getNoticeConfig().getPending().getPendingMessageId(), PROCESS_PUSH_PENDING_COMPLETE, MessagePushDTO dto = build(event.getNoticeConfig().getPending().getPendingMessageId(), PROCESS_PUSH_PENDING_COMPLETE,
event, null); event, collectionVariable(event));
sendMessageQueue(dto, PROCESS_PUSH_PENDING_COMPLETE); sendMessageQueue(dto, PROCESS_PUSH_PENDING_COMPLETE);
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("RocketMqMessagePushEventListener#onPendingComplete...end, msgTemplateId: {}, receivePerson: " + log.debug("RocketMqMessagePushEventListener#onPendingComplete...end, msgTemplateId: {}, receivePerson: " +