|
|
@@ -1,5 +1,10 @@
|
|
|
package ng_cws_client
|
|
|
|
|
|
+import (
|
|
|
+ "encoding/json"
|
|
|
+ "fmt"
|
|
|
+)
|
|
|
+
|
|
|
const (
|
|
|
EventTypeNodeAgree = iota + 1 // 节点同意事件
|
|
|
EventTypeNodeReject // 节点退回事件
|
|
|
@@ -45,3 +50,13 @@ type (
|
|
|
NodeContext string `json:"nodeContext"`
|
|
|
}
|
|
|
)
|
|
|
+
|
|
|
+func (ce CloudEvent) GetDataProcess() (*WorkflowEventDataProcess, error) {
|
|
|
+ dataProcess := new(WorkflowEventDataProcess)
|
|
|
+ err := json.Unmarshal(ce.Data, dataProcess)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println("流程回调转化json失败:", err)
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+ return dataProcess, nil
|
|
|
+}
|