Esempio n. 1
0
        /// <summary>
        /// 用途:保存流程实例的流程数据
        /// 范围:大管理员|流程模型管理员
        /// </summary>
        /// <param name="workitemInstanceGuid">当前流程活动guid</param>
        /// <param name="dataEntity">流程中所用到的数据内容</param>
        /// <returns></returns>
        public ResultMessage SaveDataEntity(string workflowInstanceGuid, IDictionary <string, string> dataEntity)
        {
            WorkflowInstance wfi = this.GetWorkflowInstance(workflowInstanceGuid);

            ///加入权限控制大管理员|流程模型管理员
            if (!(this.Context.CurUser.IsAdministrator() || wfi.GetWorkflow().Administrators.Contains(this.Context.CurUser, _uc)))
            {
                return new ResultMessage()
                       {
                           State = false, Message = "不在许可操作范围内!"
                       }
            }
            ;

            wfi.SetDataEntity(dataEntity);

            bool b = this.SetWorkflowInstance(wfi, eStoreType.Update);

            if (b)
            {
                return new ResultMessage()
                       {
                           State = true, Message = "保存流程数据成功!"
                       }
            }
            ;
            else
            {
                return new ResultMessage()
                       {
                           State = false, Message = "保存流程数据失败!"
                       }
            };
        }