Ejemplo n.º 1
0
        /// <summary>
        /// 创建一个带动态矩阵资源的流程定义
        /// </summary>
        /// <returns></returns>
        public static WfClientProcessDescriptor CreateClientProcessWithActivityMatrixResourceDescriptor()
        {
            WfClientProcessDescriptor processDesp = CreateSimpleClientProcessWithoutLines();

            WfClientActivityDescriptor actDesp = ActivityDescriptorHelper.CreateSimpleClientActivity("N1", "活动矩阵", WfClientActivityType.NormalActivity);

            actDesp.Properties.AddOrSetValue("IsDynamic", true);
            actDesp.Resources.Add(GetClientActivityMatrixResourceDescriptor());

            processDesp.Activities.Add(actDesp);

            WfClientTransitionDescriptor transitionToN1 = new WfClientTransitionDescriptor(processDesp.InitialActivity.Key, "N1")
            {
                Key = "L1"
            };

            processDesp.InitialActivity.ToTransitions.Add(transitionToN1);

            WfClientTransitionDescriptor transitionToCompleted = new WfClientTransitionDescriptor(actDesp.Key, processDesp.CompletedActivity.Key)
            {
                Key = "L2"
            };

            processDesp.Activities["N1"].ToTransitions.Add(transitionToCompleted);

            return(processDesp);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 创建一个没有连线的客户端流程对象
        /// </summary>
        /// <returns></returns>
        public static WfClientProcessDescriptor CreateSimpleClientProcessWithoutLines()
        {
            WfClientProcessDescriptor processDesp = new WfClientProcessDescriptor();

            processDesp.Key  = UuidHelper.NewUuidString();
            processDesp.Name = "客户端测试流程";

            processDesp.Activities.Add(ActivityDescriptorHelper.CreateSimpleClientActivityWithUser("Start", "开始", "Requestor", WfClientActivityType.InitialActivity));
            processDesp.Activities.Add(ActivityDescriptorHelper.CreateSimpleClientActivity("End", "结束", WfClientActivityType.CompletedActivity));

            processDesp.RelativeLinks.Add(new WfClientRelativeLinkDescriptor("AP1")
            {
                Category = "Process", Url = "http://www.ak47.com"
            });
            processDesp.CancelEventReceivers.Add(new WfClientUserResourceDescriptor(Consts.Users["Requestor"]));

            return(processDesp);
        }