Exemple #1
0
        /// <summary>
        /// nextPARALLEL: 并行节点的下一步扭转
        /// </summary>
        /// <param name="currID"></param>
        /// <param name="nextID"></param>
        /// <param name="jsonStr"></param>
        /// <param name="ext"></param>
        /// <returns></returns>
        public string denyPARALLEL(int currID, int nextID, string jsonStr, string ext = "")
        {
            string   _return = String.Empty;
            SqlTrans trans   = new SqlTrans(api);
            bool     _ifNext = false;

            try
            {
                string _pkv = "state=" + S_P_DENY, _ekv = MConvert.toUpdateSql(jsonStr);
                if (!Native.isEmpty(_ekv))
                {
                    _pkv += "," + _ekv;
                }
                int    _ifSucc = trans.execNonQuery(MString.getUpdateStr(R.Table.WF_INSTANCE, _pkv, "pid=" + currID + " and nodeName='" + MSession.get(MSession.getClientKey()) + "'"));
                string _count  = trans.execScalar("select count(*) from {0} where pid={1} and state=" + S_P_NORMAL + ";", R.Table.WF_INSTANCE, currID);
                if (_count == "0")
                {
                    _ifNext = true;
                }
                api.setDataType("json");
                _return = trans.execReader(MString.getSelectStr(R.Table.WF_INSTANCE, "*", Convert.ToInt16(currID)));
                api.setDataType("html");
                trans.commit();
            }
            catch (Exception e)
            {
                _return = Native.getErrorMsg(e.Message + "--WFInstance--nextPARALLEL");
                trans.rollback();
            }
            finally
            {
                trans.close();
            }
            if (_ifNext)
            {
                _return = nextNORMAL(currID, nextID, "", "");
            }
            return(_return);
        }