瀏覽代碼

修改流程中的异常处理代码,下一步权限放到异常处理模块

zx 4 年之前
父節點
當前提交
69a00452f3
共有 3 個文件被更改,包括 23 次插入8 次删除
  1. 14 2
      exception/exception_solver.cpp
  2. 8 6
      system/StoreProcessTask.cpp
  3. 1 0
      system/process_task.h

+ 14 - 2
exception/exception_solver.cpp

@@ -149,12 +149,24 @@ Error_manager Exception_solver::solve_exception(Error_manager code,Process_task*
                         return code;
                     case 1:
                         //异常无法处理,回退
+                        task->updata_step_statu(message::eError);
                         task->next_step();
                         return code;
                     case 2:
-                        //.....handle
+                        //code  = .....handle
                         //异常已经处理,且恢复
-                        return SUCCESS;
+                        if(code==SUCCESS)
+                        {
+                            //处理成功
+                            task->updata_step_statu(message::eFinished);
+                            task->next_step();
+                        }
+                        else{
+                            //修复失败,回退
+                            task->updata_step_statu(message::eError);
+                            task->next_step();
+                        }
+                        return code;
                     case 3:
                         task->Cancel();
                         return code;

+ 8 - 6
system/StoreProcessTask.cpp

@@ -531,20 +531,22 @@ void StoreProcessTask::Main()
             break;
         }
 
-        code!=SUCCESS?updata_step_statu(message::eError):updata_step_statu(message::eFinished);
-
         //异常处理
         if(code!=SUCCESS)
         {
             //处理异常
             code=Exception_solver::get_instance_pointer()->solve_exception(code, this);
             //根据处理结果更新步骤状态
-            code!=SUCCESS?updata_step_statu(message::eError):updata_step_statu(message::eFinished);
-        }
 
-        //本次步骤正常,切换步骤类型,进入下一步,否则不修改步骤类型,再次执行本次步骤
-        if(code==SUCCESS)
+        }
+        else
+        {
+            //本次步骤正常,切换步骤类型,进入下一步,否则不修改步骤类型,再次执行本次步骤
+            updata_step_statu(message::eFinished);
             next_step();
+        }
+
+
     }
 
     /*

+ 1 - 0
system/process_task.h

@@ -48,6 +48,7 @@ public:
         LOG(ERROR)<<"process base virtual called";
         return ERROR;};
 
+    virtual void updata_step_statu(message::Step_statu statu)=0;
 protected:
     /*
      * 发布进度消息