Beispiel #1
0
        /// <summary>
        /// 准备两个活动的创建参数,没有线参数
        /// </summary>
        /// <returns></returns>
        private static WfCreateActivityParamCollection PrepareTwoActivitiesCreateParams()
        {
            WfCreateActivityParamCollection result = new WfCreateActivityParamCollection();

            WfCreateActivityParam cap1 = new WfCreateActivityParam();

            cap1.ActivitySN = 10;

            result.Add(cap1);

            WfCreateActivityParam cap2 = new WfCreateActivityParam();

            cap2.ActivitySN = 20;

            cap2.Template.CodeName = "TestCodeName";

            result.Add(cap2);

            return(result);
        }
Beispiel #2
0
        /// <summary>
        /// 准备带线的一个活动的创建参数,一条退回到首节点,一条继续往下(默认选择)
        /// </summary>
        /// <returns></returns>
        private static WfCreateActivityParamCollection PrepareOneActivityWithTransitionsCreateParams()
        {
            WfCreateActivityParamCollection result = new WfCreateActivityParamCollection();

            WfCreateActivityParam cap1 = new WfCreateActivityParam();

            cap1.ActivitySN = 10;
            PrepareFirstCapTwoTransitions(cap1);

            result.Add(cap1);

            return(result);
        }
Beispiel #3
0
        /// <summary>
        /// 准备带线的两个活动的创建参数
        /// </summary>
        /// <returns></returns>
        private static WfCreateActivityParamCollection PrepareTwoActivitiesWithTransitionsCreateParams()
        {
            WfCreateActivityParamCollection result = new WfCreateActivityParamCollection();

            WfCreateActivityParam cap1 = new WfCreateActivityParam();

            cap1.ActivitySN = 10;
            PrepareFirstCapTwoTransitions(cap1);

            result.Add(cap1);

            WfCreateActivityParam cap2 = new WfCreateActivityParam();

            cap2.ActivitySN = 20;

            cap2.Template.CodeName = "TestCodeName";

            PrepareSecondCapTwoTransitions(cap2);

            result.Add(cap2);

            return(result);
        }
Beispiel #4
0
        //沈峥注释掉,2015/6/21.必须提供列定义
        //public void FillCreateActivityParams(WfCreateActivityParamCollection capc, PropertyDefineCollection definedProperties)
        //{
        //    SOARolePropertyDefinitionCollection definitions = null;

        //    SOARole role = this._Role as SOARole;

        //    if (role != null)
        //        definitions = role.PropertyDefinitions;
        //    else
        //        definitions = new SOARolePropertyDefinitionCollection();

        //    this.FillCreateActivityParams(capc, definitions, definedProperties);
        //}

        public void FillCreateActivityParams(WfCreateActivityParamCollection capc, SOARolePropertyDefinitionCollection definitions, PropertyDefineCollection definedProperties)
        {
            capc.NullCheck("capc");
            definitions.NullCheck("definitions");

            SOARolePropertyRowUsersCollection rowsUsers = GenerateRowsUsers();

            rowsUsers.ForEach(rowUsers => capc.Add(WfCreateActivityParam.FromRowUsers(rowUsers, definitions, definedProperties)));

            if (definitions.MatrixType == WfMatrixType.ActivityMatrix)
            {
                capc.MergeSameActivityParamBySN();
            }

            capc.ForEach(cap => InitTransitionTemplatesProperties(cap, definitions, cap.Source));
        }
        private static WfCreateActivityParamCollection UsersToCreateActivityParams(OguDataCollection <IUser> users, PropertyDefineCollection definedProperties)
        {
            WfCreateActivityParamCollection result = new WfCreateActivityParamCollection();

            int i = 0;

            foreach (IUser user in users)
            {
                WfCreateActivityParam param = new WfCreateActivityParam();

                param.ActivitySN = i++;
                param.Template.Properties.MergeDefinedProperties(definedProperties);
                param.Template.Resources.Add(new WfUserResourceDescriptor(user));
                param.Template.Variables.Add(new WfVariableDescriptor(WfProcessBuilderBase.AutoBuiltActivityVariableName, "True", DataType.Boolean));

                result.Add(param);
            }

            return(result);
        }
        /// <summary>
        /// 准备带线的一个活动的创建参数,一条退回到首节点,一条继续往下(默认选择)
        /// </summary>
        /// <returns></returns>
        private static WfCreateActivityParamCollection PrepareOneActivityWithTransitionsCreateParams()
        {
            WfCreateActivityParamCollection result = new WfCreateActivityParamCollection();

            WfCreateActivityParam cap1 = new WfCreateActivityParam();

            cap1.ActivitySN = 10;
            PrepareFirstCapTwoTransitions(cap1);

            result.Add(cap1);

            return result;
        }
        /// <summary>
        /// 准备带线的两个活动的创建参数
        /// </summary>
        /// <returns></returns>
        private static WfCreateActivityParamCollection PrepareTwoActivitiesWithTransitionsCreateParams()
        {
            WfCreateActivityParamCollection result = new WfCreateActivityParamCollection();

            WfCreateActivityParam cap1 = new WfCreateActivityParam();

            cap1.ActivitySN = 10;
            PrepareFirstCapTwoTransitions(cap1);

            result.Add(cap1);

            WfCreateActivityParam cap2 = new WfCreateActivityParam();

            cap2.ActivitySN = 20;

            cap2.Template.CodeName = "TestCodeName";

            PrepareSecondCapTwoTransitions(cap2);

            result.Add(cap2);

            return result;
        }
        /// <summary>
        /// 准备两个活动的创建参数,没有线参数
        /// </summary>
        /// <returns></returns>
        private static WfCreateActivityParamCollection PrepareTwoActivitiesCreateParams()
        {
            WfCreateActivityParamCollection result = new WfCreateActivityParamCollection();

            WfCreateActivityParam cap1 = new WfCreateActivityParam();

            cap1.ActivitySN = 10;

            result.Add(cap1);

            WfCreateActivityParam cap2 = new WfCreateActivityParam();

            cap2.ActivitySN = 20;

            cap2.Template.CodeName = "TestCodeName";

            result.Add(cap2);

            return result;
        }