From 3388fcc6f354116b31465d87f5c46ba1f2dafefe Mon Sep 17 00:00:00 2001 From: mr Date: Thu, 3 Oct 2024 17:25:54 +0200 Subject: [PATCH] add workflow func tools --- models/workflow/workflow.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/models/workflow/workflow.go b/models/workflow/workflow.go index 19f7fa1..f5359e3 100644 --- a/models/workflow/workflow.go +++ b/models/workflow/workflow.go @@ -26,6 +26,15 @@ type AbstractWorkflow struct { Shared []string `json:"shared,omitempty" bson:"shared,omitempty"` // Shared is the ID of the shared workflow } +func (w *AbstractWorkflow) getWorkflows() (list_computings []graph.GraphItem) { + for _, item := range w.Graph.Items { + if item.Workflow != nil { + list_computings = append(list_computings, item) + } + } + return +} + func (w *AbstractWorkflow) GetStoragesByRelatedProcessing(processingID string, relatedToData bool, ignoreRelation bool) (map[string][]utils.DBObject, map[string]map[string][]utils.DBObject) { storages := make(map[string][]utils.DBObject) datasRelatedToStorage := make(map[string]map[string][]utils.DBObject) @@ -93,7 +102,7 @@ func (w *AbstractWorkflow) GetDatasByRelatedProcessing(dataID string, relatedToS return datas, datasRelatedToData } -func (w *AbstractWorkflow) getProcessingsByRelatedProcessing() (list_computings []graph.GraphItem) { +func (w *AbstractWorkflow) getProcessings() (list_computings []graph.GraphItem) { for _, item := range w.Graph.Items { if item.Processing != nil { list_computings = append(list_computings, item)