Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [SubWorkflowLogicTask] missing scheduleTime param during schedule or run complement in sub-workflow #16768

Open
3 tasks done
reele opened this issue Nov 5, 2024 · 2 comments
Assignees
Labels
backend bug Something isn't working

Comments

@reele
Copy link
Contributor

reele commented Nov 5, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

What happened

SubWorkflowLogicTask.triggerNewSubWorkflow only use WorkflowManualTriggerRequest to build request, the sub-workflow instance's scheduleTime param will be missing in schedule run.

private SubWorkflowLogicTaskRuntimeContext triggerNewSubWorkflow() {
final WorkflowInstance workflowInstance = workflowExecutionRunnable.getWorkflowInstance();
final WorkflowDefinition subWorkflowDefinition = applicationContext.getBean(WorkflowDefinitionDao.class)
.queryByCode(taskParameters.getWorkflowDefinitionCode())
.orElseThrow(() -> new IllegalArgumentException(
"Cannot find the sub workflow definition: " + taskParameters.getWorkflowDefinitionCode()));
final ICommandParam commandParam =
JSONUtils.parseObject(workflowInstance.getCommandParam(), ICommandParam.class);
final WorkflowManualTriggerRequest workflowManualTriggerRequest = WorkflowManualTriggerRequest.builder()
.userId(taskExecutionContext.getExecutorId())
.workflowDefinitionCode(subWorkflowDefinition.getCode())
.workflowDefinitionVersion(subWorkflowDefinition.getVersion())
.failureStrategy(workflowInstance.getFailureStrategy())
.warningType(workflowInstance.getWarningType())
.warningGroupId(workflowInstance.getWarningGroupId())
.workflowInstancePriority(workflowInstance.getWorkflowInstancePriority())
.workerGroup(workflowInstance.getWorkerGroup())
.tenantCode(workflowInstance.getTenantCode())
.environmentCode(workflowInstance.getEnvironmentCode())
// todo: transport varpool and local params
.startParamList(commandParam.getCommandParams())
.dryRun(Flag.of(workflowInstance.getDryRun()))
.testFlag(Flag.of(workflowInstance.getTestFlag()))
.build();
final Integer subWorkflowInstanceId = applicationContext
.getBean(SubWorkflowControlClient.class)
.triggerSubWorkflow(workflowManualTriggerRequest);
return SubWorkflowLogicTaskRuntimeContext.of(subWorkflowInstanceId);
}

What you expected to happen

may use WorkflowScheduleTriggerRequest when the parent workflow instance's scheduleTime is not null ?

How to reproduce

schedule or complement run a workflow with sub process, which with dependent node (the DependentAsyncTaskExecuteFunction will got a wrong dependentDate)

Anything else

No response

Version

dev

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@reele reele added bug Something isn't working Waiting for reply Waiting for reply labels Nov 5, 2024
@reele reele changed the title [Bug] [SubWorkflowLogicTask] missing scheduleTime param in schedule or run complement in sub-workflow [Bug] [SubWorkflowLogicTask] missing scheduleTime param during schedule or run complement in sub-workflow Nov 5, 2024
@SbloodyS
Copy link
Member

SbloodyS commented Nov 5, 2024

I've assigned to you. Looking forward to your contribution.

@SbloodyS SbloodyS added backend and removed Waiting for reply Waiting for reply labels Nov 5, 2024
@reele
Copy link
Contributor Author

reele commented Nov 5, 2024

I've assigned to you. Looking forward to your contribution.

OK

reele added a commit to reele/dolphinscheduler that referenced this issue Nov 5, 2024
reele added a commit to reele/dolphinscheduler that referenced this issue Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants