set up
This commit is contained in:
@@ -106,10 +106,14 @@ func (o *Order) draftStoreFromModel(scheduler *workflow_execution.WorkflowSchedu
|
||||
// set the name of the order
|
||||
resourcesByPeer := map[string][]pricing.PricedItemITF{} // create a map of resources by peer
|
||||
|
||||
processings := scheduler.Workflow.GetPricedItem(scheduler.Workflow.Graph.IsProcessing, request) // get the processing items
|
||||
datas := scheduler.Workflow.GetPricedItem(scheduler.Workflow.Graph.IsData, request) // get the data items
|
||||
storages := scheduler.Workflow.GetPricedItem(scheduler.Workflow.Graph.IsStorage, request) // get the storage items
|
||||
workflows := scheduler.Workflow.GetPricedItem(scheduler.Workflow.Graph.IsWorkflow, request) // get the workflow items
|
||||
processings := scheduler.Workflow.GetPricedItem(scheduler.Workflow.Graph.IsProcessing, request,
|
||||
int(scheduler.SelectedBuyingStrategy), scheduler.SelectedPricingStrategy) // get the processing items
|
||||
datas := scheduler.Workflow.GetPricedItem(scheduler.Workflow.Graph.IsData, request,
|
||||
int(scheduler.SelectedBuyingStrategy), scheduler.SelectedPricingStrategy) // get the data items
|
||||
storages := scheduler.Workflow.GetPricedItem(scheduler.Workflow.Graph.IsStorage, request,
|
||||
int(scheduler.SelectedBuyingStrategy), scheduler.SelectedPricingStrategy) // get the storage items
|
||||
workflows := scheduler.Workflow.GetPricedItem(scheduler.Workflow.Graph.IsWorkflow, request,
|
||||
int(scheduler.SelectedBuyingStrategy), scheduler.SelectedPricingStrategy) // get the workflow items
|
||||
for _, items := range []map[string]pricing.PricedItemITF{processings, datas, storages, workflows} {
|
||||
for _, item := range items {
|
||||
if _, ok := resourcesByPeer[item.GetCreatorID()]; !ok {
|
||||
@@ -167,7 +171,8 @@ func (o *Order) draftBookOrder(scheduler *workflow_execution.WorkflowSchedule, r
|
||||
return draftedBookings, errors.New("no request found")
|
||||
}
|
||||
for _, exec := range scheduler.WorkflowExecution {
|
||||
_, priceds, _, err := scheduler.Workflow.Planify(exec.ExecDate, exec.EndDate, request)
|
||||
_, priceds, _, err := scheduler.Workflow.Planify(exec.ExecDate, exec.EndDate, request,
|
||||
int(scheduler.SelectedBuyingStrategy), scheduler.SelectedPricingStrategy)
|
||||
if err != nil {
|
||||
return draftedBookings, errors.New("could not planify the workflow" + fmt.Sprintf("%v", err))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user