|
|
@@ -299,6 +299,39 @@ func (w *WFClient) Run(instanceId, userId, choice, options, nextStep string, c *
|
|
|
return []byte{}, nil
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * @brief: run the wf instance
|
|
|
+ * @param1 instanceId: id of instance
|
|
|
+ * @param2 userId: approver id
|
|
|
+ * @param3 choice: choice
|
|
|
+ * @param4 options: options
|
|
|
+ * @return1 content of response
|
|
|
+ * @return2 error
|
|
|
+ */
|
|
|
+func (w *WFClient) NewStep(instanceId, userId, choice, options, nextStep string, c *entitys.CtrlContext) ([]byte, error) {
|
|
|
+ url := w.getFullUrl("api/wf_instance/newstep")
|
|
|
+
|
|
|
+ params := make(map[string]string)
|
|
|
+ params["instance_id"] = instanceId
|
|
|
+ params["users"] = userId
|
|
|
+ if choice != "" {
|
|
|
+ params["choice"] = choice
|
|
|
+ }
|
|
|
+ if options != "" {
|
|
|
+ params["opinion"] = options
|
|
|
+ }
|
|
|
+ if nextStep != "" {
|
|
|
+ params["nextStep"] = nextStep
|
|
|
+ }
|
|
|
+
|
|
|
+ bytess, err := HttpClientInstance().post(url, params, nil)
|
|
|
+ if err != nil {
|
|
|
+ return nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ return bytess, err
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* @brief: pre the wf instance
|
|
|
* @param1 instanceId: id of instance
|