reele commented on issue #17161:
URL:
https://github.com/apache/dolphinscheduler/issues/17161#issuecomment-3149872239
this is my approach:
1. add entity `WorkflowExecution or WorkflowTrigger or WorkflowTriggerAction
or...` to persist data of request
- id
- mainWorkflowDefinitionCode
- trigger_type
- trigger_time
2. add execution_id to WorkflowInstance
3. modify WorkflowManualTriggerRequest:
- add workflowExecutionId field
4. modify SubWorkflowLogicTask:
- pass parent-workflow's workflowExecutionId to
workflowManualTriggerRequest in triggerNewSubWorkflow
5. modify AbstractWorkflowTrigger:
1. add abstract method `constructWorkflowExecution` returns
WorkflowExecution.id
1. set submit_time to `WorkflowExecution.trigger_time` in
`WorkflowManualTrigger.constructWorkflowExecution`
2. set schedule_time to `WorkflowExecution.trigger_time` in
`[WorkflowScheduleTrigger/WorkflowBackfillTrigger].constructWorkflowExecution`
3. set WorkflowManualTriggerRequest.workflowExecutionId to
`WorkflowExecution.trigger_time` in
`SubWorkflowManualTrigger.constructWorkflowExecution`
2. add parameter workflowExecutionId to constructWorkflowInstance, set
workflowExecutionId into new workflowInstance
3. call constructWorkflowExecution and save in `triggerWorkflow` before
call constructWorkflowInstance, pass returned value workflowExecution.id to
constructWorkflowInstance
6. modify WorkflowInstanceMapper
- rewrite
queryLastRunningWorkflow/queryLastManualWorkflow/queryLastRunningWorkflow with
sql segment:
`(select * from t_ds_workflow_instance where
workflow_definition_code=... and workflow_execution_id in (select id from
t_ds_workflow_execution where trigger_type in (...) and #{startTime} >=
trigger_time and #{endTime} <= trigger_time))`
- modify ddl to optimize index of t_ds_workflow_instance
- add dml to re-generate t_ds_workflow_execution for old
workflow_instance
7. modify DependentExecute:
- add depend option[schedule/manual/all] maps
trigger_type[backfill,schedule/manual]
- rewrite `findDependentWorkflowCandidate` with mapper's new method
8. modify DependentNode(optional)
- add depend option[schedule/manual/all] to UI and DependentLogicTask
@ruanwenjun could you please advise on this approach?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]