nil except
This commit is contained in:
parent
b125c9be01
commit
ed4cb943a8
models
@ -103,11 +103,12 @@ func (wfa *workflowMongoAccessor) execute(workflow *Workflow) {
|
|||||||
accessor := (&workspace.Workspace{}).GetAccessor()
|
accessor := (&workspace.Workspace{}).GetAccessor()
|
||||||
filters := &dbs.Filters{
|
filters := &dbs.Filters{
|
||||||
Or: map[string]dbs.Filter{
|
Or: map[string]dbs.Filter{
|
||||||
"abstractobject.name": {Operator: dbs.LIKE.String(), Value: workflow.Name + "_workspace"},
|
"abstractobject.name": {dbs.LIKE.String(), workflow.Name + "_workspace"},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
resource, _, err := accessor.Search(filters, "")
|
resource, _, err := accessor.Search(filters, "")
|
||||||
if err == nil && len(resource) == 1 {
|
fmt.Println(resource)
|
||||||
|
if err == nil && len(resource) > 0 {
|
||||||
accessor.UpdateOne(&workspace.Workspace{
|
accessor.UpdateOne(&workspace.Workspace{
|
||||||
Active: true,
|
Active: true,
|
||||||
ResourceSet: resources.ResourceSet{
|
ResourceSet: resources.ResourceSet{
|
||||||
|
@ -11,7 +11,8 @@ import (
|
|||||||
type Workspace struct {
|
type Workspace struct {
|
||||||
utils.AbstractObject
|
utils.AbstractObject
|
||||||
resources.ResourceSet
|
resources.ResourceSet
|
||||||
Active bool `json:"active" bson:"active" default:"false"`
|
IsContextual bool `json:"is_contextual" bson:"is_contextual" default:"false"`
|
||||||
|
Active bool `json:"active" bson:"active" default:"false"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ao *Workspace) GetID() string {
|
func (ao *Workspace) GetID() string {
|
||||||
|
Loading…
Reference in New Issue
Block a user