activation workspace
This commit is contained in:
parent
e311553eb1
commit
4f27aefc4b
@ -134,9 +134,9 @@ func (wfa *workflowMongoAccessor) LoadOne(id string) (utils.DBObject, int, error
|
|||||||
// add to workspace
|
// add to workspace
|
||||||
accessor := (&workspace.Workspace{}).GetAccessor()
|
accessor := (&workspace.Workspace{}).GetAccessor()
|
||||||
resource, _, err := accessor.Search(workflow.Name+"_workspace", "abstractobject.name")
|
resource, _, err := accessor.Search(workflow.Name+"_workspace", "abstractobject.name")
|
||||||
if err == nil && len(resource) > 0 {
|
if err == nil && len(resource) == 1 {
|
||||||
for _, r := range resource {
|
|
||||||
accessor.UpdateOne(&workspace.Workspace{
|
accessor.UpdateOne(&workspace.Workspace{
|
||||||
|
Active: true,
|
||||||
ResourceSet: resources.ResourceSet{
|
ResourceSet: resources.ResourceSet{
|
||||||
Datas: workflow.Datas,
|
Datas: workflow.Datas,
|
||||||
Processings: workflow.Processings,
|
Processings: workflow.Processings,
|
||||||
@ -144,10 +144,10 @@ func (wfa *workflowMongoAccessor) LoadOne(id string) (utils.DBObject, int, error
|
|||||||
Workflows: workflow.Workflows,
|
Workflows: workflow.Workflows,
|
||||||
Datacenters: workflow.Datacenters,
|
Datacenters: workflow.Datacenters,
|
||||||
},
|
},
|
||||||
}, r.GetID())
|
}, resource[0].GetID())
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
accessor.StoreOne(&workspace.Workspace{
|
accessor.StoreOne(&workspace.Workspace{
|
||||||
|
Active: true,
|
||||||
AbstractObject: utils.AbstractObject{Name: workflow.Name + "_workspace"},
|
AbstractObject: utils.AbstractObject{Name: workflow.Name + "_workspace"},
|
||||||
ResourceSet: resources.ResourceSet{
|
ResourceSet: resources.ResourceSet{
|
||||||
Datas: workflow.Datas,
|
Datas: workflow.Datas,
|
||||||
|
Loading…
Reference in New Issue
Block a user