|
@ -311,11 +311,10 @@ func createNewWorkflowMove(tx *gorm.DB,oldWfm *model.WorkflowMove, targetNodeID |
|
|
WorkflowProcessID: oldWfm.WorkflowProcessID, |
|
|
WorkflowProcessID: oldWfm.WorkflowProcessID, |
|
|
Param: "", |
|
|
Param: "", |
|
|
Action: "", |
|
|
Action: "", |
|
|
IsActive: true,}) |
|
|
|
|
|
|
|
|
IsActive: true}) |
|
|
return nil, newWfm |
|
|
return nil, newWfm |
|
|
case model.INCLUSIVE_GATEWAY: |
|
|
case model.INCLUSIVE_GATEWAY: |
|
|
// 当为包容网关时,需要等待其他网关执行结束才进行创建
|
|
|
// 当为包容网关时,需要等待其他网关执行结束才进行创建
|
|
|
|
|
|
|
|
|
txErr := tx.Find(&edges, "workflow_process_id = ? and target = ?", oldWfm.WorkflowProcessID, nodeInfo.ID).Error |
|
|
txErr := tx.Find(&edges, "workflow_process_id = ? and target = ?", oldWfm.WorkflowProcessID, nodeInfo.ID).Error |
|
|
if txErr != nil { |
|
|
if txErr != nil { |
|
|
return txErr, []model.WorkflowMove{} |
|
|
return txErr, []model.WorkflowMove{} |
|
@ -332,12 +331,20 @@ func createNewWorkflowMove(tx *gorm.DB,oldWfm *model.WorkflowMove, targetNodeID |
|
|
return nil, []model.WorkflowMove{} |
|
|
return nil, []model.WorkflowMove{} |
|
|
} |
|
|
} |
|
|
if len(wfms) == len(edges) { |
|
|
if len(wfms) == len(edges) { |
|
|
//var params string
|
|
|
|
|
|
//for _,v := range wfms{
|
|
|
|
|
|
// params += v.Param
|
|
|
|
|
|
//}
|
|
|
|
|
|
//参数携带模式暂时未定
|
|
|
|
|
|
txErr := tx.First(&edge, "workflow_process_id = ? and source = ?", oldWfm.WorkflowProcessID, nodeInfo.ID).Error |
|
|
|
|
|
|
|
|
params := make(map[string]int) |
|
|
|
|
|
var param string |
|
|
|
|
|
var temp int |
|
|
|
|
|
for _, v := range wfms { |
|
|
|
|
|
params[v.Param]++ |
|
|
|
|
|
} |
|
|
|
|
|
for k, v := range params { |
|
|
|
|
|
if temp < v { |
|
|
|
|
|
temp = v |
|
|
|
|
|
param = k |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
//参数携带模式暂时未定 暂时为少数服从多数原则 后续会增加原则配置 (少数服从多数,仅一关键字即为关键字,所有关键字才为关键字 三种方案)
|
|
|
|
|
|
txErr := tx.First(&edge, "workflow_process_id = ? and source = ? and condition_expression = ?", oldWfm.WorkflowProcessID, nodeInfo.ID, param).Error |
|
|
if txErr != nil { |
|
|
if txErr != nil { |
|
|
return txErr, []model.WorkflowMove{} |
|
|
return txErr, []model.WorkflowMove{} |
|
|
} |
|
|
} |
|
@ -350,7 +357,7 @@ func createNewWorkflowMove(tx *gorm.DB,oldWfm *model.WorkflowMove, targetNodeID |
|
|
WorkflowProcessID: oldWfm.WorkflowProcessID, |
|
|
WorkflowProcessID: oldWfm.WorkflowProcessID, |
|
|
Param: "", |
|
|
Param: "", |
|
|
Action: "", |
|
|
Action: "", |
|
|
IsActive: true,}) |
|
|
|
|
|
|
|
|
IsActive: true}) |
|
|
} |
|
|
} |
|
|
return nil, newWfm |
|
|
return nil, newWfm |
|
|
|
|
|
|
|
@ -370,7 +377,7 @@ func createNewWorkflowMove(tx *gorm.DB,oldWfm *model.WorkflowMove, targetNodeID |
|
|
WorkflowProcessID: oldWfm.WorkflowProcessID, |
|
|
WorkflowProcessID: oldWfm.WorkflowProcessID, |
|
|
Param: "", |
|
|
Param: "", |
|
|
Action: "", |
|
|
Action: "", |
|
|
IsActive: true,}) |
|
|
|
|
|
|
|
|
IsActive: true}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return nil, newWfm |
|
|
return nil, newWfm |
|
@ -385,7 +392,7 @@ func createNewWorkflowMove(tx *gorm.DB,oldWfm *model.WorkflowMove, targetNodeID |
|
|
WorkflowProcessID: oldWfm.WorkflowProcessID, |
|
|
WorkflowProcessID: oldWfm.WorkflowProcessID, |
|
|
Param: "", |
|
|
Param: "", |
|
|
Action: "", |
|
|
Action: "", |
|
|
IsActive: true,}) |
|
|
|
|
|
|
|
|
IsActive: true}) |
|
|
return nil, newWfm |
|
|
return nil, newWfm |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|