Save and display execution records

This commit is contained in:
yoan
2024-11-20 15:47:51 +08:00
parent 03b2a9da66
commit 2d10fa0218
18 changed files with 405 additions and 54 deletions

View File

@@ -8,15 +8,20 @@ import (
type workflowProcessor struct {
workflow *domain.Workflow
logs []RunLog
logs []domain.RunLog
}
func NewWorkflowProcessor(workflow *domain.Workflow) *workflowProcessor {
return &workflowProcessor{
workflow: workflow,
logs: make([]domain.RunLog, 0),
}
}
func (w *workflowProcessor) Log(ctx context.Context) []domain.RunLog {
return w.logs
}
func (w *workflowProcessor) Run(ctx context.Context) error {
ctx = WithWorkflowId(ctx, w.workflow.Id)
return w.runNode(ctx, w.workflow.Content)