workflow execution evolved
This commit is contained in:
parent
31ec352b57
commit
3d13833572
@ -21,7 +21,7 @@ import (
|
||||
* Booking is a struct that represents a booking
|
||||
*/
|
||||
|
||||
type Order{} struct {
|
||||
type Order struct {
|
||||
utils.AbstractObject
|
||||
OrderBy string `json:"order_by" bson:"order_by" validate:"required"`
|
||||
WorkflowID string `json:"workflow_id" bson:"workflow_id" validate:"required"`
|
||||
@ -98,7 +98,7 @@ func (o *Order) draftStoreFromModel(scheduler *workflow_execution.WorkflowSchedu
|
||||
o.SetName()
|
||||
o.WorkflowID = scheduler.Workflow.GetID()
|
||||
o.IsDraft = true
|
||||
o.OrderBy = request.Username
|
||||
o.OrderBy = request.PeerID
|
||||
o.WorkflowExecutionIDs = []string{} // create an array of ids
|
||||
for _, exec := range scheduler.WorkflowExecutions {
|
||||
o.WorkflowExecutionIDs = append(o.WorkflowExecutionIDs, exec.GetID())
|
||||
@ -141,7 +141,7 @@ func (o *Order) draftStoreFromModel(scheduler *workflow_execution.WorkflowSchedu
|
||||
res, code, err := o.GetAccessor(request).Search(&dbs.Filters{
|
||||
And: map[string][]dbs.Filter{
|
||||
"workflow_id": {{Operator: dbs.EQUAL.String(), Value: o.WorkflowID}},
|
||||
"order_by": {{Operator: dbs.EQUAL.String(), Value: request.Username}},
|
||||
"order_by": {{Operator: dbs.EQUAL.String(), Value: request.PeerID}},
|
||||
},
|
||||
}, "", o.IsDraft)
|
||||
if code != 200 || err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user