From f372f1d58a5df6377c0c7316cd34ff0b2a957b1b Mon Sep 17 00:00:00 2001 From: tangjiawei Date: Mon, 23 Dec 2024 13:50:24 +0800 Subject: [PATCH] =?UTF-8?q?#2477=20=E4=BB=BB=E5=8A=A1=E7=BC=96=E6=8E=92?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E5=8E=86=E5=8F=B2=E6=98=BE=E7=A4=BA=E8=8A=82?= =?UTF-8?q?=E7=82=B9=E6=89=A7=E8=A1=8C=E6=AC=A1=E6=95=B0=E5=92=8C=E6=95=B0?= =?UTF-8?q?=E6=8D=AE,=E5=AD=90=E7=BC=96=E6=8E=92=E7=BB=93=E7=82=B9?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/database/process-exec.go | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/platform-core/services/database/process-exec.go b/platform-core/services/database/process-exec.go index 84412693bc..275d70a391 100644 --- a/platform-core/services/database/process-exec.go +++ b/platform-core/services/database/process-exec.go @@ -1516,19 +1516,17 @@ func GetProcInsNodeContext(ctx context.Context, procInsId, procInsNodeId, procDe if len(procReqParams) == 0 { return } - curDataIndex := 0 - curReqObj := models.ProcNodeContextReqObject{CallbackParameter: procReqParams[0].CallbackId} - tmpInputMap := make(map[string]interface{}) - tmpOutputMap := make(map[string]interface{}) - for _, row := range procReqParams { - // 子编排结点处理 - if row.FromType == models.JobSubProcType { + // 子编排结点处理 + if queryObj.NodeType == models.JobSubProcType { + for _, row := range procReqParams { var sucProcRows []*models.ProcContextSubProcRow + tmpInputMap := make(map[string]interface{}) + tmpOutputMap := make(map[string]interface{}) db.MysqlEngine.Context(ctx).SQL("select t2.entity_type_id,t2.entity_data_id,t2.id as proc_ins_id,t3.id as proc_def_id,t3.name as proc_def_name,t1.status,t1.error_message from proc_run_workflow t1 join proc_ins t2 on t1.proc_ins_id = t2.id join proc_def t3 on t2.proc_def_id = t3.id where t1.proc_ins_id=?", row.DataValue).Get(&sucProcRows) if len(sucProcRows) == 0 { continue } - curReqObj = models.ProcNodeContextReqObject{CallbackParameter: fmt.Sprintf("%s:%s", row.EntityTypeId, row.EntityDataId)} + curReqObj := models.ProcNodeContextReqObject{CallbackParameter: fmt.Sprintf("%s:%s", row.EntityTypeId, row.EntityDataId)} tmpInputMap["entityTypeId"] = row.EntityTypeId tmpInputMap["entityDataId"] = row.EntityDataId tmpOutputMap["procDefId"] = sucProcRows[0].ProcDefId @@ -1538,7 +1536,16 @@ func GetProcInsNodeContext(ctx context.Context, procInsId, procInsNodeId, procDe tmpOutputMap["status"] = sucProcRows[0].Status tmpOutputMap["errorMessage"] = sucProcRows[0].ErrorMessage tmpOutputMap["createdTime"] = row.CreatedTime.Format(models.DateTimeFormat) - } else { + curReqObj.Inputs = append(curReqObj.Inputs, tmpInputMap) + curReqObj.Outputs = append(curReqObj.Outputs, tmpOutputMap) + tempProcNodeContext.RequestObjects = append(tempProcNodeContext.RequestObjects, curReqObj) + } + } else { + curDataIndex := 0 + curReqObj := models.ProcNodeContextReqObject{CallbackParameter: procReqParams[0].CallbackId} + tmpInputMap := make(map[string]interface{}) + tmpOutputMap := make(map[string]interface{}) + for _, row := range procReqParams { if row.DataIndex != curDataIndex { curDataIndex = row.DataIndex curReqObj.Inputs = []map[string]interface{}{tmpInputMap} @@ -1554,10 +1561,10 @@ func GetProcInsNodeContext(ctx context.Context, procInsId, procInsNodeId, procDe tmpOutputMap[row.Name] = getInterfaceDataByDataType(row.DataValue, row.DataType, row.Name, row.Multiple, row.IsSensitive) } } + curReqObj.Inputs = []map[string]interface{}{tmpInputMap} + curReqObj.Outputs = []map[string]interface{}{tmpOutputMap} + tempProcNodeContext.RequestObjects = append(tempProcNodeContext.RequestObjects, curReqObj) } - curReqObj.Inputs = []map[string]interface{}{tmpInputMap} - curReqObj.Outputs = []map[string]interface{}{tmpOutputMap} - tempProcNodeContext.RequestObjects = append(tempProcNodeContext.RequestObjects, curReqObj) result = append(result, tempProcNodeContext) } return