adding inputs output struct based on argo naming for now
This commit is contained in:
parent
826d7586b1
commit
787c01b4be
@ -52,8 +52,13 @@ func (w *Workflow) GetPricedItem(f func(item graph.GraphItem) bool, request *too
|
|||||||
return list_datas
|
return list_datas
|
||||||
}
|
}
|
||||||
|
|
||||||
func (w *Workflow) GetByRelatedProcessing(processingID string, g func(item graph.GraphItem) bool) []resources.ResourceInterface {
|
type Related struct {
|
||||||
storages := []resources.ResourceInterface{}
|
Nodes []resources.ResourceInterface
|
||||||
|
Links []graph.GraphLink
|
||||||
|
}
|
||||||
|
|
||||||
|
func (w *Workflow) GetByRelatedProcessing(processingID string, g func(item graph.GraphItem) bool) map[string]Related {
|
||||||
|
related := map[string]Related{}
|
||||||
for _, link := range w.Graph.Links {
|
for _, link := range w.Graph.Links {
|
||||||
nodeID := link.Destination.ID
|
nodeID := link.Destination.ID
|
||||||
var node resources.ResourceInterface
|
var node resources.ResourceInterface
|
||||||
@ -67,10 +72,16 @@ func (w *Workflow) GetByRelatedProcessing(processingID string, g func(item graph
|
|||||||
_, node = item.GetResource() // we are looking for the storage as destination
|
_, node = item.GetResource() // we are looking for the storage as destination
|
||||||
}
|
}
|
||||||
if processingID == nodeID && node != nil { // if the storage is linked to the processing
|
if processingID == nodeID && node != nil { // if the storage is linked to the processing
|
||||||
storages = append(storages, node)
|
if _, ok := related[processingID]; !ok {
|
||||||
|
related[processingID] = Related{}
|
||||||
|
}
|
||||||
|
rel := related[processingID]
|
||||||
|
rel.Nodes = append(rel.Nodes, node)
|
||||||
|
rel.Links = append(rel.Links, link)
|
||||||
|
related[processingID] = rel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return storages
|
return related
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ao *Workflow) VerifyAuth(request *tools.APIRequest) bool {
|
func (ao *Workflow) VerifyAuth(request *tools.APIRequest) bool {
|
||||||
|
Loading…
Reference in New Issue
Block a user