correct workflow problem

This commit is contained in:
mr 2024-08-28 17:14:01 +02:00
parent 2f44ad0eff
commit a53e3c987d
2 changed files with 6 additions and 6 deletions

View File

@ -13,7 +13,7 @@ type GraphItem struct {
Width float64 `bson:"width" json:"width" validate:"required"`
Height float64 `bson:"height" json:"height" validate:"required"`
Position Position `bson:"position" json:"position" validate:"required"`
resources.ItemResource
*resources.ItemResource
}
type GraphLink struct {

View File

@ -178,13 +178,13 @@ func (wfa *workflowMongoAccessor) UpdateOne(set utils.DBObject, id string) (util
if code != 200 {
return nil, 409, err
}
new := set.(*Workflow)
//new := set.(*Workflow)
avoid := set.(*Workflow).Schedule == nil || (res.(*Workflow).Schedule != nil && res.(*Workflow).ScheduleActive == set.(*Workflow).ScheduleActive && res.(*Workflow).Schedule.Start == set.(*Workflow).Schedule.Start && res.(*Workflow).Schedule.End == set.(*Workflow).Schedule.End && res.(*Workflow).Schedule.Cron == set.(*Workflow).Schedule.Cron)
for _, i := range new.Graph.Items {
/*for _, i := range new.Graph.Items {
if i.Datacenter == nil && i.Processing == nil && i.Storage == nil && i.Workflow == nil && i.Data == nil {
return nil, 422, errors.New("graph item should have at least one resource data is corrupted")
}
}
}*/
res, code, err = wfa.GenericUpdateOne(set, id, wfa, &Workflow{})
if code != 200 {
return nil, code, err
@ -199,12 +199,12 @@ func (wfa *workflowMongoAccessor) UpdateOne(set utils.DBObject, id string) (util
}
func (wfa *workflowMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, int, error) {
new := data.(*Workflow)
/*new := data.(*Workflow)
for _, i := range new.Graph.Items {
if i.Datacenter == nil && i.Processing == nil && i.Storage == nil && i.Workflow == nil && i.Data == nil {
return nil, 422, errors.New("graph item should have at least one resource data is corrupted")
}
}
}*/
res, code, err := wfa.GenericStoreOne(data, wfa)
if err != nil {
return nil, code, err