feat: 2.6.0
1. 优化回调节点和条件节点日志
This commit is contained in:
parent
1fdddf3095
commit
6a1e7fd99b
@ -46,6 +46,7 @@ import java.util.concurrent.TimeUnit;
|
|||||||
@Component
|
@Component
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
public class CallbackWorkflowExecutor extends AbstractWorkflowExecutor {
|
public class CallbackWorkflowExecutor extends AbstractWorkflowExecutor {
|
||||||
|
|
||||||
private static final String SECRET = "secret";
|
private static final String SECRET = "secret";
|
||||||
private static final String CALLBACK_TIMEOUT = "10";
|
private static final String CALLBACK_TIMEOUT = "10";
|
||||||
private final RestTemplate restTemplate;
|
private final RestTemplate restTemplate;
|
||||||
@ -94,7 +95,10 @@ public class CallbackWorkflowExecutor extends AbstractWorkflowExecutor {
|
|||||||
.withRetryListener(new RetryListener() {
|
.withRetryListener(new RetryListener() {
|
||||||
@Override
|
@Override
|
||||||
public <V> void onRetry(final Attempt<V> attempt) {
|
public <V> void onRetry(final Attempt<V> attempt) {
|
||||||
EasyRetryLog.LOCAL.error("回调接口第 【{}】 重试. 回调配置信息: [{}]", attempt.getAttemptNumber(), JsonUtil.toJsonString(decisionConfig));
|
if (attempt.hasException()) {
|
||||||
|
EasyRetryLog.LOCAL.error("回调接口第 【{}】 重试. 回调配置信息: [{}]",
|
||||||
|
attempt.getAttemptNumber(), JsonUtil.toJsonString(decisionConfig));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}).build();
|
}).build();
|
||||||
|
|
||||||
@ -105,7 +109,8 @@ public class CallbackWorkflowExecutor extends AbstractWorkflowExecutor {
|
|||||||
result = response.getBody();
|
result = response.getBody();
|
||||||
EasyRetryLog.LOCAL.info("回调结果. webHook:[{}],结果: [{}]", decisionConfig.getWebhook(), result);
|
EasyRetryLog.LOCAL.info("回调结果. webHook:[{}],结果: [{}]", decisionConfig.getWebhook(), result);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
EasyRetryLog.LOCAL.error("回调异常. webHook:[{}],参数: [{}]", decisionConfig.getWebhook(), context.getTaskResult(), e);
|
EasyRetryLog.LOCAL.error("回调异常. webHook:[{}],参数: [{}]", decisionConfig.getWebhook(),
|
||||||
|
context.getTaskResult(), e);
|
||||||
taskBatchStatus = JobTaskBatchStatusEnum.FAIL.getStatus();
|
taskBatchStatus = JobTaskBatchStatusEnum.FAIL.getStatus();
|
||||||
operationReason = JobOperationReasonEnum.WORKFLOW_CALLBACK_NODE_EXECUTOR_ERROR.getReason();
|
operationReason = JobOperationReasonEnum.WORKFLOW_CALLBACK_NODE_EXECUTOR_ERROR.getReason();
|
||||||
jobTaskStatus = JobTaskStatusEnum.FAIL.getStatus();
|
jobTaskStatus = JobTaskStatusEnum.FAIL.getStatus();
|
||||||
@ -152,7 +157,8 @@ public class CallbackWorkflowExecutor extends AbstractWorkflowExecutor {
|
|||||||
EasyRetryLog.REMOTE.info("workflowNodeId:[{}] 回调成功. 回调参数:[{}] 回调结果:[{}] <|>{}<|>",
|
EasyRetryLog.REMOTE.info("workflowNodeId:[{}] 回调成功. 回调参数:[{}] 回调结果:[{}] <|>{}<|>",
|
||||||
context.getWorkflowNodeId(), context.getTaskResult(), context.getTaskResult(), logMetaDTO);
|
context.getWorkflowNodeId(), context.getTaskResult(), context.getTaskResult(), logMetaDTO);
|
||||||
} else {
|
} else {
|
||||||
EasyRetryLog.REMOTE.error("workflowNodeId:[{}] 回调失败. 失败原因:[{}] <|>{}<|>", context.getWorkflowNodeId(),
|
EasyRetryLog.REMOTE.error("workflowNodeId:[{}] 回调失败. 失败原因:[{}] <|>{}<|>",
|
||||||
|
context.getWorkflowNodeId(),
|
||||||
context.getLogMessage(), logMetaDTO);
|
context.getLogMessage(), logMetaDTO);
|
||||||
|
|
||||||
// 尝试完成任务
|
// 尝试完成任务
|
||||||
|
@ -140,7 +140,8 @@ public class ConditionWorkflowExecutor extends AbstractWorkflowExecutor {
|
|||||||
logMetaDTO.setTaskBatchId(jobTaskBatch.getId());
|
logMetaDTO.setTaskBatchId(jobTaskBatch.getId());
|
||||||
logMetaDTO.setJobId(SystemConstants.DECISION_JOB_ID);
|
logMetaDTO.setJobId(SystemConstants.DECISION_JOB_ID);
|
||||||
logMetaDTO.setTaskId(jobTask.getId());
|
logMetaDTO.setTaskId(jobTask.getId());
|
||||||
if (jobTaskBatch.getTaskBatchStatus() == JobTaskStatusEnum.SUCCESS.getStatus()) {
|
if (jobTaskBatch.getTaskBatchStatus() == JobTaskStatusEnum.SUCCESS.getStatus()
|
||||||
|
|| JobOperationReasonEnum.WORKFLOW_NODE_NO_OPERATION_REQUIRED.getReason() == context.getOperationReason()) {
|
||||||
EasyRetryLog.REMOTE.info("workflowNodeId:[{}]决策完成. 决策结果:[{}] <|>{}<|>",
|
EasyRetryLog.REMOTE.info("workflowNodeId:[{}]决策完成. 决策结果:[{}] <|>{}<|>",
|
||||||
context.getWorkflowNodeId(), context.getEvaluationResult(), logMetaDTO);
|
context.getWorkflowNodeId(), context.getEvaluationResult(), logMetaDTO);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user