Adjust + Test
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
"cloud.o-forge.io/core/oc-lib/models/booking"
|
||||
"cloud.o-forge.io/core/oc-lib/models/collaborative_area/shallow_collaborative_area"
|
||||
"cloud.o-forge.io/core/oc-lib/models/common"
|
||||
"cloud.o-forge.io/core/oc-lib/models/common/models"
|
||||
"cloud.o-forge.io/core/oc-lib/models/common/pricing"
|
||||
"cloud.o-forge.io/core/oc-lib/models/peer"
|
||||
"cloud.o-forge.io/core/oc-lib/models/resources"
|
||||
@@ -41,7 +42,9 @@ type Workflow struct {
|
||||
Graph *graph.Graph `bson:"graph,omitempty" json:"graph,omitempty"` // Graph UI & logic representation of the workflow
|
||||
ScheduleActive bool `json:"schedule_active" bson:"schedule_active"` // ScheduleActive is a flag that indicates if the schedule is active, if not the workflow is not scheduled and no execution or booking will be set
|
||||
// Schedule *WorkflowSchedule `bson:"schedule,omitempty" json:"schedule,omitempty"` // Schedule is the schedule of the workflow
|
||||
Shared []string `json:"shared,omitempty" bson:"shared,omitempty"` // Shared is the ID of the shared workflow // AbstractWorkflow contains the basic fields of a workflow
|
||||
Shared []string `json:"shared,omitempty" bson:"shared,omitempty"` // Shared is the ID of the shared workflow // AbstractWorkflow contains the basic fields of a workflow
|
||||
Env []models.Param `json:"env,omitempty" bson:"env,omitempty"`
|
||||
Inputs []models.Param `json:"inputs,omitempty" bson:"inputs,omitempty"`
|
||||
}
|
||||
|
||||
func (d *Workflow) GetAccessor(request *tools.APIRequest) utils.Accessor {
|
||||
@@ -390,11 +393,13 @@ func (w *Workflow) GetPricedItem(
|
||||
for _, item := range w.Graph.Items {
|
||||
if f(item) {
|
||||
dt, res := item.GetResource()
|
||||
|
||||
ord, err := res.ConvertToPricedResource(dt, &instance, &partnership, &buying, &strategy, &bookingMode, request)
|
||||
if err != nil {
|
||||
return list_datas, err
|
||||
}
|
||||
list_datas[res.GetID()] = ord
|
||||
|
||||
}
|
||||
}
|
||||
return list_datas, nil
|
||||
@@ -445,6 +450,7 @@ func (ao *Workflow) VerifyAuth(callName string, request *tools.APIRequest) bool
|
||||
return ao.AbstractObject.VerifyAuth(callName, request) || isAuthorized
|
||||
}
|
||||
|
||||
// TODO : Check Booking... + Storage
|
||||
/*
|
||||
* CheckBooking is a function that checks the booking of the workflow on peers (even ourselves)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user