Add a Name to Workflow Execution

This commit is contained in:
mr
2024-08-06 08:40:05 +02:00
parent dd5f8f5b2d
commit d2484e84f0
4 changed files with 17 additions and 2 deletions

View File

@@ -56,6 +56,9 @@ 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,
@@ -66,6 +69,9 @@ 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,

View File

@@ -4,6 +4,7 @@ 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"`