update - REQ-2324-修复转换job内容报错问题

This commit is contained in:
yangqicheng 2024-05-27 11:47:45 +08:00
parent 368e2211c0
commit 16b2c80ab7

View File

@ -9,10 +9,9 @@ import com.google.common.collect.ImmutableSet;
import lombok.extern.slf4j.Slf4j;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEventType;
import org.flowable.common.engine.api.delegate.event.FlowableEvent;
import org.flowable.common.engine.impl.event.FlowableEngineEventImpl;
import org.flowable.common.engine.impl.event.FlowableEntityEventImpl;
import org.flowable.engine.delegate.event.AbstractFlowableEngineEventListener;
import org.flowable.job.service.impl.persistence.entity.AbstractJobEntity;
import org.flowable.job.service.impl.persistence.entity.JobEntity;
import org.slf4j.MDC;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.stereotype.Component;
@ -56,7 +55,7 @@ public class EngineAsyncJobEventListener extends AbstractFlowableEngineEventList
StopWatch stopWatch = new StopWatch("EngineAsyncJobEventListener");
stopWatch.start("async-job-event-listener");
if (ASYNC_JOB_EVENTS.contains(flowableEvent.getType())) {
if (flowableEvent instanceof FlowableEngineEventImpl) {
if (flowableEvent instanceof FlowableEntityEventImpl) {
resolveJobInfoBeforeOperate((FlowableEntityEventImpl) flowableEvent);
}
getOrderedListeners().forEach(i -> {
@ -81,8 +80,8 @@ public class EngineAsyncJobEventListener extends AbstractFlowableEngineEventList
}
Object entity = flowableEvent.getEntity();
log.info("resolve job info,eventInfo:{},jobEntity:{}", JSONUtil.toJsonStr(flowableEvent), entity);
if (entity instanceof AbstractJobEntity) {
AbstractJobEntity jobInfo = (AbstractJobEntity) entity;
if (entity instanceof JobEntity) {
JobEntity jobInfo = (JobEntity) entity;
String customValues = jobInfo.getCustomValues();
if (AsyncJobUtils.isWrappedCustomValues(customValues)) {
AsyncJobUtils.WrappedJobCustomValuesInfo wrappedInfo = AsyncJobUtils.convert2WrappedCustomValuesInfo(customValues);