Переглянути джерело

修改工作流回调参数

huangyh 6 роки тому
батько
коміт
b031e986b0
1 змінених файлів з 29 додано та 25 видалено
  1. 29 25
      wfclient/client.go

+ 29 - 25
wfclient/client.go

@@ -25,14 +25,15 @@ type FilterField struct {
 }
 
 type CallbackArg struct {
-	DefineId   string
-	InstanceId string
-	DefineName string
-	FormData   string
-	Choice     string
-	Executor   string
-	UserId     string
-	Context    *entitys.CtrlContext
+	DefineId     string
+	InstanceId   string
+	DefineName   string
+	InstanceName string
+	FormData     string
+	Choice       string
+	Executor     string
+	UserId       string
+	Context      *entitys.CtrlContext
 }
 
 type WFClient struct {
@@ -240,6 +241,7 @@ func (w *WFClient) Run(instanceId, userId, choice, options, nextStep string, c *
 		DefineId      string      `json:"define_id"`
 		InstanceId    string      `json:"instance_id"`
 		DefineName    string      `json:"define_name"`
+		InstanceName  string      `json:"instance_name"`
 		Choices       []*Choice   `json:"choices"`
 		Transition    *Transition `json:"transition"`
 		StepType      string      `json:"step_type"`
@@ -254,7 +256,7 @@ func (w *WFClient) Run(instanceId, userId, choice, options, nextStep string, c *
 	if err != nil {
 		return nil, err
 	}
-	fmt.Println("------------->>>>>--------", string(bytess))
+	//fmt.Println("------------->>>>>--------", string(bytess))
 	err = json.Unmarshal(bytess, &RunRespInfo)
 	if err != nil {
 		return nil, err
@@ -269,14 +271,15 @@ func (w *WFClient) Run(instanceId, userId, choice, options, nextStep string, c *
 		if ok {
 			fmt.Println("------------------------------------->121")
 			callback(CallbackArg{
-				DefineId:   RunRespInfo.DefineId,
-				InstanceId: instanceId,
-				DefineName: RunRespInfo.DefineName,
-				FormData:   RunRespInfo.FormData,
-				Choice:     choice,
-				Executor:   RunRespInfo.Executor,
-				UserId:     w.userId,
-				Context:    c,
+				DefineId:     RunRespInfo.DefineId,
+				InstanceId:   RunRespInfo.DefineId,
+				DefineName:   RunRespInfo.DefineName,
+				InstanceName: RunRespInfo.InstanceName,
+				FormData:     RunRespInfo.FormData,
+				Choice:       choice,
+				Executor:     RunRespInfo.Executor,
+				UserId:       w.userId,
+				Context:      c,
 			})
 		}
 	}
@@ -297,14 +300,15 @@ func (w *WFClient) Run(instanceId, userId, choice, options, nextStep string, c *
 		callback, ok := w.callbackMap[callbackKye]
 		if ok {
 			callback(CallbackArg{
-				DefineId:   RunRespInfo.DefineId,
-				InstanceId: instanceId,
-				DefineName: RunRespInfo.DefineName,
-				FormData:   RunRespInfo.FormData,
-				Choice:     choice,
-				Executor:   RunRespInfo.Executor,
-				UserId:     w.userId,
-				Context:    c,
+				DefineId:     RunRespInfo.DefineId,
+				InstanceId:   instanceId,
+				DefineName:   RunRespInfo.DefineName,
+				InstanceName: RunRespInfo.InstanceName,
+				FormData:     RunRespInfo.FormData,
+				Choice:       choice,
+				Executor:     RunRespInfo.Executor,
+				UserId:       w.userId,
+				Context:      c,
 			})
 		}
 	}