feat(sj_1.1.0-beta2): 透传配置的工作流上下文至批次中

This commit is contained in:
opensnail 2024-06-27 16:20:33 +08:00
parent 2e240fe89a
commit daf563a163
6 changed files with 18 additions and 1 deletions

View File

@ -53,4 +53,9 @@ public class WorkflowPartitionTaskDTO extends PartitionTask {
*/
private String flowInfo;
/**
* 工作流上下文
*/
private String wfContext;
}

View File

@ -73,4 +73,9 @@ public class WorkflowTaskPrepareDTO {
* 仅做超时检测
*/
private boolean onlyTimeoutCheck;
/**
* 工作流上下文
*/
private String wfContext;
}

View File

@ -134,7 +134,7 @@ public class ScanWorkflowTaskActor extends AbstractActor {
new LambdaQueryWrapper<Workflow>()
.select(Workflow::getId, Workflow::getGroupName, Workflow::getNextTriggerAt, Workflow::getTriggerType,
Workflow::getTriggerInterval, Workflow::getExecutorTimeout, Workflow::getNamespaceId,
Workflow::getFlowInfo, Workflow::getBlockStrategy)
Workflow::getFlowInfo, Workflow::getBlockStrategy, Workflow::getWfContext)
.eq(Workflow::getWorkflowStatus, StatusEnum.YES.getStatus())
.eq(Workflow::getDeleted, StatusEnum.NO.getStatus())
.in(Workflow::getBucketIndex, scanTask.getBuckets())

View File

@ -55,6 +55,7 @@ public class WorkflowTaskPrepareActor extends AbstractActor {
// 终态任务
if (workflowPrePareHandler.matches(null)) {
workflowPrePareHandler.handler(workflowTaskPrepareDTO);
break;
}
}
} else {

View File

@ -34,6 +34,7 @@ public class WorkflowBatchGenerator {
WorkflowTaskBatch workflowTaskBatch = WorkflowTaskConverter.INSTANCE.toWorkflowTaskBatch(context);
workflowTaskBatch.setTaskBatchStatus(Optional.ofNullable(context.getTaskBatchStatus()).orElse(JobTaskBatchStatusEnum.WAITING.getStatus()));
workflowTaskBatch.setOperationReason(context.getOperationReason());
workflowTaskBatch.setWfContext(context.getWfContext());
Assert.isTrue(1 == workflowTaskBatchMapper.insert(workflowTaskBatch), () -> new SnailJobServerException("新增调度任务失败. [{}]", context.getWorkflowId()));

View File

@ -47,5 +47,10 @@ public class WorkflowTaskBatchGeneratorContext {
*/
private String flowInfo;
/**
* 工作流上下文
*/
private String wfContext;
}