correct workflow problem
This commit is contained in:
parent
2f44ad0eff
commit
a53e3c987d
@ -13,7 +13,7 @@ type GraphItem struct {
|
|||||||
Width float64 `bson:"width" json:"width" validate:"required"`
|
Width float64 `bson:"width" json:"width" validate:"required"`
|
||||||
Height float64 `bson:"height" json:"height" validate:"required"`
|
Height float64 `bson:"height" json:"height" validate:"required"`
|
||||||
Position Position `bson:"position" json:"position" validate:"required"`
|
Position Position `bson:"position" json:"position" validate:"required"`
|
||||||
resources.ItemResource
|
*resources.ItemResource
|
||||||
}
|
}
|
||||||
|
|
||||||
type GraphLink struct {
|
type GraphLink struct {
|
||||||
|
@ -178,13 +178,13 @@ func (wfa *workflowMongoAccessor) UpdateOne(set utils.DBObject, id string) (util
|
|||||||
if code != 200 {
|
if code != 200 {
|
||||||
return nil, 409, err
|
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)
|
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 {
|
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")
|
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{})
|
res, code, err = wfa.GenericUpdateOne(set, id, wfa, &Workflow{})
|
||||||
if code != 200 {
|
if code != 200 {
|
||||||
return nil, code, err
|
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) {
|
func (wfa *workflowMongoAccessor) StoreOne(data utils.DBObject) (utils.DBObject, int, error) {
|
||||||
new := data.(*Workflow)
|
/*new := data.(*Workflow)
|
||||||
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 {
|
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")
|
return nil, 422, errors.New("graph item should have at least one resource data is corrupted")
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
res, code, err := wfa.GenericStoreOne(data, wfa)
|
res, code, err := wfa.GenericStoreOne(data, wfa)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, code, err
|
return nil, code, err
|
||||||
|
Loading…
Reference in New Issue
Block a user