Esempio n. 1
0
        /// <summary>
        /// 保存流程变量
        /// </summary>
        /// <param name="entity">流程实体</param>
        /// <returns>流程变量ID</returns>
        public int SaveProcessVariable(ProcessVariableEntity entity)
        {
            var pvm      = new ProcessVariableManager();
            var entityID = pvm.SaveVariable(entity);

            return(entityID);
        }
Esempio n. 2
0
        /// <summary>
        /// 设置变量
        /// </summary>
        /// <param name="name">名称</param>
        /// <param name="value">数值</param>
        /// <param name="variableType">变量类型</param>
        public void SaveVariable(ProcessVariableTypeEnum variableType, string name, string value)
        {
            var pvm = new ProcessVariableManager();
            ProcessVariableEntity entity = null;

            if (variableType == ProcessVariableTypeEnum.Process)
            {
                //设置流程变量
                entity = new ProcessVariableEntity
                {
                    VariableType      = ProcessVariableTypeEnum.Process.ToString(),
                    AppInstanceID     = this.AppInstanceID,
                    ProcessGUID       = this.ProcessGUID,
                    ProcessInstanceID = this.ProcessInstanceID,
                    Name  = name,
                    Value = value,
                    LastUpdatedDateTime = System.DateTime.Now
                };
            }
            else if (variableType == ProcessVariableTypeEnum.Activity)
            {
                entity = new ProcessVariableEntity
                {
                    VariableType      = ProcessVariableTypeEnum.Activity.ToString(),
                    AppInstanceID     = this.AppInstanceID,
                    ProcessGUID       = this.ProcessGUID,
                    ProcessInstanceID = this.ProcessInstanceID,
                    ActivityGUID      = this.ActivityGUID,
                    ActivityName      = this.ActivityName,
                    Name  = name,
                    Value = value,
                    LastUpdatedDateTime = System.DateTime.Now
                };
            }
            pvm.SaveVariable(Session.Connection, entity, Session.Transaction);
        }