Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/context/submission/domain/submission/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ type RunConfig struct {
MainWorkflowFilePath string
WorkflowEngineParameters map[string]interface{}
Version string
WorkflowVersionID string
}

func NewEventCreateRuns(workspaceID, submissionID, submissionType string, inputs, outputs map[string]interface{}, dataModelID *string, DataModelRowIDs []string, runConfig *RunConfig) *EventCreateRuns {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,16 @@ func (h *CreateHandler) Handle(ctx context.Context, event *CreateEvent) (err err
if err != nil {
return err
}
// todo we should store the data model & workflow used in submission
createRunEvent, err := h.genCreateRunEvent(ctx, event, sub)
if err != nil {
return err
}

// write workflowVersionID into submission table
sub.WorkflowVersionID = createRunEvent.RunConfig.WorkflowVersionID
err = h.repository.Save(ctx, sub)
if err != nil {
return err
}
return h.eventbus.Publish(ctx, createRunEvent)
}

Expand Down Expand Up @@ -71,6 +75,7 @@ func (h *CreateHandler) genCreateRunEvent(ctx context.Context, event *CreateEven
WorkflowContents: files,
WorkflowEngineParameters: workflowEngineParameters,
Version: getWorkflowVersionResp.Version.LanguageVersion,
WorkflowVersionID: getWorkflowVersionResp.Version.Id,
}), nil

}
Expand Down