feat: 2.6.0

1. 修复任务失败重试导致后续节点为成功执行问题
2. 修复客户端返回的非json对象导致解析失败问题
This commit is contained in:
byteblogs168 2024-01-18 22:46:43 +08:00
parent b31003ef5e
commit b44b741a9e
5 changed files with 17 additions and 2 deletions

View File

@ -117,4 +117,9 @@ public interface SystemConstants {
* 系统内置的回调任务ID
*/
Long CALLBACK_JOB_ID = -2000L;
/**
* 客户端返回的非json对象单值比如 "aa", 123等
*/
String SINGLE_PARAM = "SINGLE_PARAM";
}

View File

@ -44,6 +44,7 @@ public enum JobOperationReasonEnum {
* 工作流后续节点跳过执行配置
*/
public static final List<Integer> WORKFLOW_SUCCESSOR_SKIP_EXECUTE = Arrays.asList(
WORKFLOW_NODE_NO_OPERATION_REQUIRED.getReason(), WORKFLOW_DECISION_FOR_FALSE.getReason());
WORKFLOW_NODE_NO_OPERATION_REQUIRED.getReason(), WORKFLOW_DECISION_FOR_FALSE.getReason(),
WORKFLOW_CONDITION_NODE_EXECUTOR_ERROR.reason);
}

View File

@ -48,6 +48,8 @@ public abstract class AbstractClientCallbackHandler implements ClientCallbackHan
JobTask jobTask = context.getJobTask();
RealJobExecutorDTO realJobExecutor = JobTaskConverter.INSTANCE.toRealJobExecutorDTO(JobTaskConverter.INSTANCE.toJobExecutorContext(job), jobTask);
realJobExecutor.setClientId(ClientInfoUtils.clientId(context.getClientInfo()));
realJobExecutor.setWorkflowNodeId(context.getWorkflowNodeId());
realJobExecutor.setWorkflowTaskBatchId(context.getWorkflowTaskBatchId());
ActorRef actorRef = ActorGenerator.jobRealTaskExecutorActor();
actorRef.tell(realJobExecutor, actorRef);
LogMetaDTO logMetaDTO = JobTaskConverter.INSTANCE.toJobLogDTO(context);

View File

@ -1,6 +1,7 @@
package com.aizuda.easy.retry.server.job.task.support.expression;
import cn.hutool.core.util.StrUtil;
import com.aizuda.easy.retry.common.core.constant.SystemConstants;
import com.aizuda.easy.retry.common.core.exception.EasyRetryCommonException;
import com.aizuda.easy.retry.common.core.util.JsonUtil;
import com.aizuda.easy.retry.server.common.exception.EasyRetryServerException;
@ -32,7 +33,11 @@ public class ExpressionInvocationHandler implements InvocationHandler {
String params = (String) expressionParams[0];
Map<String, Object> contextMap = new HashMap<>();
if (StrUtil.isNotBlank(params)) {
contextMap = JsonUtil.parseHashMap(params);
try {
contextMap = JsonUtil.parseHashMap(params);
} catch (Exception e) {
contextMap.put(SystemConstants.SINGLE_PARAM, params);
}
}
args[1] = new Object[]{contextMap};

View File

@ -18,6 +18,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import org.springframework.util.CollectionUtils;
@ -41,6 +42,7 @@ public class JobTaskBatchHandler {
@Autowired
private JobTaskBatchMapper jobTaskBatchMapper;
@Transactional
public boolean complete(CompleteJobBatchDTO completeJobBatchDTO) {
List<JobTask> jobTasks = jobTaskMapper.selectList(