Пример #1
0
        /// <summary>
        /// 获取出去的Transation
        /// </summary>
        /// <returns></returns>
        public List <TransationInstance> GetSplitTransationInstance()
        {
            List <Transation> listTransation = this.Activity.SplitTransations;

            List <TransationInstance> listTransationInstance = new List <TransationInstance>();

            foreach (Transation trans in listTransation)
            {
                TransationInstance instTrans = new TransationInstance();

                instTrans.Create(this.ID, trans.ID);

                instTrans.Parse();

                listTransationInstance.Add(instTrans);
            }

            return(listTransationInstance);
        }
Пример #2
0
        /// <summary>
        /// 得到下一关卡集合
        /// </summary>
        /// <param name="activityInstanceId">关卡实例id</param>
        /// <returns>关卡集合</returns>
        public List <F_ACTIVITY> GetNextActivitys(int activityInstId)
        {
            List <F_ACTIVITY> listActivity = new List <F_ACTIVITY>();

            using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions()
            {
                IsolationLevel = IsolationLevel.ReadCommitted
            }))
            {
                //获得关卡的发散Transation
                ActivityInstance activityInst = new ActivityInstance(activityInstId);

                List <Transation> listTransation = activityInst.Activity.SplitTransations;

                List <TransationInstance> listTransationInstance = new List <TransationInstance>();

                //实例化Transation并解析
                foreach (Transation trans in listTransation)
                {
                    //解析Transation条件
                    TransationInstance transInst = new TransationInstance();
                    transInst.Create(activityInst.ID, trans.ID);
                    transInst.Parse();

                    if (transInst.Value)
                    {
                        //关卡集合
                        F_ACTIVITY activity = new F_ACTIVITY();

                        activity.ID   = transInst.Transation.ToActivity.ID;
                        activity.Name = transInst.Transation.ToActivity.Name;

                        listActivity.Add(activity);
                    }
                }

                scope.Complete();

                return(listActivity);
            }
        }