txErr:=tx.First(&edge,"workflow_process_id = ? and source = ? and condition_expression = ?",oldWfm.WorkflowProcessID,nodeInfo.ID,oldWfm.Param).Error
iftxErr!=nil{
txErr:=tx.First(&edge,"workflow_process_id = ? and source = ? and condition_expression = ?",oldWfm.WorkflowProcessID,nodeInfo.ID,oldWfm.Param).Error
iftxErr!=nil{
returntxErr,[]model.WorkflowMove{}
returntxErr,[]model.WorkflowMove{}
}
}
newWfm=append(newWfm,model.WorkflowMove{
BusinessID:oldWfm.BusinessID,
BusinessType:oldWfm.BusinessType,
PromoterID:oldWfm.PromoterID,
OperatorID:0,
WorkflowNodeID:edge.Target,
WorkflowProcessID:oldWfm.WorkflowProcessID,
Param:"",
Action:"",
IsActive:true,})
returnnil,newWfm
newWfm=append(newWfm,model.WorkflowMove{
BusinessID:oldWfm.BusinessID,
BusinessType:oldWfm.BusinessType,
PromoterID:oldWfm.PromoterID,
OperatorID:0,
WorkflowNodeID:edge.Target,
WorkflowProcessID:oldWfm.WorkflowProcessID,
Param:"",
Action:"",
IsActive:true})
returnnil,newWfm
casemodel.INCLUSIVE_GATEWAY:
casemodel.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
iftxErr!=nil{
returntxErr,[]model.WorkflowMove{}
iftxErr!=nil{
returntxErr,[]model.WorkflowMove{}
}
}
varsourceIds[]string
varsourceIds[]string
for_,v:=rangeedges{
for_,v:=rangeedges{
sourceIds=append(sourceIds,v.Source)
sourceIds=append(sourceIds,v.Source)
}
}
txErr=tx.Find(&wfms,"workflow_process_id = ? and business_id = ? and workflow_node_id in (?) and is_active = ?",oldWfm.WorkflowProcessID,oldWfm.BusinessID,sourceIds,false).Error
iftxErr!=nil{
returntxErr,[]model.WorkflowMove{}
}
iflen(wfms)!=len(edges){
returnnil,[]model.WorkflowMove{}
}
iflen(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
iftxErr!=nil{
returntxErr,[]model.WorkflowMove{}
txErr=tx.Find(&wfms,"workflow_process_id = ? and business_id = ? and workflow_node_id in (?) and is_active = ?",oldWfm.WorkflowProcessID,oldWfm.BusinessID,sourceIds,false).Error