Compare commits
No commits in common. "29fcd0e34a72b66ef30811eeb6fe3b87b805b69e" and "17f62b6495239c025459527ac08ad2db9ec6b083" have entirely different histories.
29fcd0e34a
...
17f62b6495
@ -56,9 +56,6 @@ func (wfa *workflowMongoAccessor) execution(id string, realData *Workflow, delet
|
||||
}
|
||||
for s := c.Next(*realData.Schedule.Start); !s.IsZero() && s.Before(*realData.Schedule.End); s = c.Next(s) {
|
||||
obj := &workflow_execution.WorkflowExecution{
|
||||
AbstractObject: utils.AbstractObject{
|
||||
Name: realData.Schedule.Name,
|
||||
},
|
||||
ExecDate: &s,
|
||||
EndDate: realData.Schedule.End,
|
||||
State: 1,
|
||||
@ -69,9 +66,6 @@ func (wfa *workflowMongoAccessor) execution(id string, realData *Workflow, delet
|
||||
|
||||
} else {
|
||||
obj := &workflow_execution.WorkflowExecution{
|
||||
AbstractObject: utils.AbstractObject{
|
||||
Name: realData.Schedule.Name,
|
||||
},
|
||||
ExecDate: realData.Schedule.Start,
|
||||
EndDate: realData.Schedule.End,
|
||||
State: 1,
|
||||
|
@ -4,7 +4,6 @@ import "time"
|
||||
|
||||
type WorkflowSchedule struct {
|
||||
Id string `json:"id"`
|
||||
Name string `json:"name" bson:"name" validate:"required"`
|
||||
Start *time.Time `json:"start" bson:"start" validate:"required"`
|
||||
End *time.Time `json:"end,omitempty" bson:"end,omitempty"`
|
||||
Cron string `json:"cron,omitempty" bson:"cron,omitempty"`
|
||||
|
@ -38,7 +38,7 @@ func (d ScheduledType) EnumIndex() int {
|
||||
}
|
||||
|
||||
type WorkflowExecution struct {
|
||||
utils.AbstractObject
|
||||
UUID string `json:"id,omitempty" bson:"id,omitempty" validate:"required"`
|
||||
ExecDate *time.Time `json:"execution_date,omitempty" bson:"execution_date,omitempty" validate:"required"`
|
||||
EndDate *time.Time `json:"end_date,omitempty" bson:"end_date,omitempty"`
|
||||
State int64 `json:"state,omitempty" bson:"state,omitempty"`
|
||||
|
@ -53,26 +53,18 @@ func (wfa workflowExecutionMongoAccessor) LoadAll() ([]utils.ShallowDBObject, in
|
||||
return nil, 404, err
|
||||
}
|
||||
for _, r := range results {
|
||||
objs = append(objs, &r.AbstractObject)
|
||||
objs = append(objs, &r)
|
||||
}
|
||||
return objs, 200, nil
|
||||
}
|
||||
|
||||
func (wfa *workflowExecutionMongoAccessor) Search(filters *dbs.Filters, search string) ([]utils.ShallowDBObject, int, error) {
|
||||
objs := []utils.ShallowDBObject{}
|
||||
if (filters == nil || len(filters.And) == 0 || len(filters.Or) == 0) && search != "" {
|
||||
filters = &dbs.Filters{
|
||||
Or: map[string][]dbs.Filter{
|
||||
"abstractobject.name": {{Operator: dbs.LIKE.String(), Value: search}},
|
||||
},
|
||||
}
|
||||
}
|
||||
res_mongo, code, err := mongo.MONGOService.Search(filters, wfa.GetType())
|
||||
if err != nil {
|
||||
wfa.Logger.Error().Msg("Could not store to db. Error: " + err.Error())
|
||||
return nil, code, err
|
||||
}
|
||||
|
||||
var results []WorkflowExecution
|
||||
if err = res_mongo.All(mongo.MngoCtx, &results); err != nil {
|
||||
return nil, 404, err
|
||||
|
Loading…
Reference in New Issue
Block a user