示例#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);
        }
示例#2
0
        /// <summary>
        /// 获取变量列表
        /// </summary>
        /// <param name="query">变量查询</param>
        /// <returns>活动实例列表</returns>
        public IList <ProcessVariableEntity> GetProcessVariableList(ProcessVariableQuery query)
        {
            var pvm  = new ProcessVariableManager();
            var list = pvm.GetVariableList(query.ProcessInstanceID);

            return(list);
        }
示例#3
0
        /// <summary>
        /// 获取流程变量
        /// </summary>
        /// <param name="query">查询</param>
        /// <returns>变量实体</returns>
        public ProcessVariableEntity GetProcessVariable(ProcessVariableQuery query)
        {
            var pvm    = new ProcessVariableManager();
            var entity = pvm.GetVariableEntity(query);

            return(entity);
        }
示例#4
0
        /// <summary>
        /// 获取流程变量
        /// </summary>
        /// <param name="variableID">变量ID</param>
        /// <returns>变量实体</returns>
        public ProcessVariableEntity GetProcessVariable(int variableID)
        {
            var pvm    = new ProcessVariableManager();
            var entity = pvm.GetVariableEntity(variableID);

            return(entity);
        }
示例#5
0
        /// <summary>
        /// 获取变量
        /// </summary>
        /// <param name="name">名称</param>
        /// <param name="variableType">变量类型</param>
        /// <returns>数值</returns>
        public string GetVariable(ProcessVariableTypeEnum variableType, string name)
        {
            //查询活动变量
            var value = string.Empty;
            ProcessVariableQuery query = null;
            var pvm = new ProcessVariableManager();

            if (variableType == ProcessVariableTypeEnum.Process)
            {
                //查询流程变量
                query = new ProcessVariableQuery
                {
                    VariableType      = ProcessVariableTypeEnum.Process,
                    ProcessInstanceID = this.ProcessInstanceID,
                    Name = name
                };
                value = pvm.GetVariableValue(Session.Connection, query, Session.Transaction);
            }
            else if (variableType == ProcessVariableTypeEnum.Activity)
            {
                query = new ProcessVariableQuery
                {
                    VariableType      = ProcessVariableTypeEnum.Activity,
                    ProcessInstanceID = this.ProcessInstanceID,
                    ActivityGUID      = this.ActivityGUID,
                    Name = name
                };
                value = pvm.GetVariableValue(Session.Connection, query, Session.Transaction);
            }
            return(value);
        }
示例#6
0
        /// <summary>
        /// 验证触发表达式是否满足
        /// </summary>
        /// <param name="conn">链接</param>
        /// <param name="processInstanceID">流程实例ID</param>
        /// <param name="expression">表达式</param>
        /// <param name="trans">事务</param>
        /// <returns></returns>
        public Boolean ValidateProcessVariable(int processInstanceID, string expression)
        {
            var isValidated = false;

            using (var conn = SessionFactory.CreateConnection())
            {
                var pvm = new ProcessVariableManager();
                isValidated = pvm.ValidateProcessVariable(conn, processInstanceID, expression, null);
            }
            return(isValidated);
        }
示例#7
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);
        }
示例#8
0
        /// <summary>
        /// 删除流程变量
        /// </summary>
        /// <param name="variableID">变量ID</param>
        public void DeleteProcessVariable(int variableID)
        {
            var pvm = new ProcessVariableManager();

            pvm.DeleteVariable(variableID);
        }