Beispiel #1
0
        public void InvalidActivityDescriptionTest()
        {
            IWfProcessDescriptor processDesp = WfProcessTestCommon.CreateInitAndCompletedProcessDescriptor();

            WfCreateActivityParamCollection caps = PrepareTwoActivitiesCreateParams();

            caps.CreateActivities(processDesp, false);

            string targetKey = caps[0].CreatedDescriptor.Key;

            caps.FindActivityByActivityDescription(processDesp, null, string.Format("Invalid(\"{0}\")", targetKey));
        }
Beispiel #2
0
        public void SecondCapTransitionsTest()
        {
            IWfProcessDescriptor processDesp = WfProcessTestCommon.CreateInitAndCompletedProcessDescriptor();

            WfCreateActivityParamCollection caps = PrepareTwoActivitiesWithTransitionsCreateParams();

            caps.CreateActivities(processDesp, false);

            processDesp.Output();

            ValidateSecondCapTwoTransitionsProperties(caps[1]);
        }
Beispiel #3
0
        public void CodeNameActivityDescriptionTest()
        {
            IWfProcessDescriptor processDesp = WfProcessTestCommon.CreateInitAndCompletedProcessDescriptor();

            WfCreateActivityParamCollection caps = PrepareTwoActivitiesCreateParams();

            caps.CreateActivities(processDesp, false);

            IWfActivityDescriptor matchedActDesp = caps.FindActivityByActivityDescription(processDesp, null, "CodeName(\"TestCodeName\")");

            Assert.AreEqual(processDesp.Activities.Find(actDesp => actDesp.CodeName == "TestCodeName").Key, matchedActDesp.Key);
        }
Beispiel #4
0
        public void IntSNActivityDescriptionTest()
        {
            IWfProcessDescriptor processDesp = WfProcessTestCommon.CreateInitAndCompletedProcessDescriptor();

            WfCreateActivityParamCollection caps = PrepareTwoActivitiesCreateParams();

            caps.CreateActivities(processDesp, false);

            IWfActivityDescriptor matchedActDesp = caps.FindActivityByActivityDescription(processDesp, null, "10");

            Assert.AreEqual(processDesp.InitialActivity.ToTransitions.FirstOrDefault().ToActivity.Key, matchedActDesp.Key);
        }
Beispiel #5
0
        public void FirstCapTransitionsTest()
        {
            IWfProcessDescriptor processDesp = ProcessHelper.CreateInitAndCompletedProcessDescriptor();

            WfCreateActivityParamCollection caps = PrepareTwoActivitiesWithTransitionsCreateParams();

            caps.CreateActivities(processDesp, false);

            processDesp.OutputEveryActivities();

            ValidateFirstCapTwoTransitionsProperties(caps[0]);
        }
Beispiel #6
0
        public void LastActivityDescriptionTest()
        {
            IWfProcessDescriptor processDesp = ProcessHelper.CreateInitAndCompletedProcessDescriptor();

            WfCreateActivityParamCollection caps = PrepareTwoActivitiesCreateParams();

            caps.CreateActivities(processDesp, false);

            IWfActivityDescriptor matchedActDesp = caps.FindActivityByActivityDescription(processDesp, null, "LastActivity");

            Assert.AreEqual(processDesp.CompletedActivity.Key, matchedActDesp.Key);
        }
Beispiel #7
0
        public void DefaultNextActivityDescriptionTest()
        {
            IWfProcessDescriptor processDesp = WfProcessTestCommon.CreateInitAndCompletedProcessDescriptor();

            WfCreateActivityParamCollection caps = PrepareTwoActivitiesCreateParams();

            caps.CreateActivities(processDesp, false);

            IWfActivityDescriptor matchedActDesp = caps.FindActivityByActivityDescription(processDesp, caps[0],
                                                                                          WfCreateActivityParam.DefaultNextActivityDescription);

            Assert.AreEqual(caps[0].DefaultNextDescriptor.Key, matchedActDesp.Key);
        }
Beispiel #8
0
        public void DirectKeyActivityDescriptionTest()
        {
            IWfProcessDescriptor processDesp = WfProcessTestCommon.CreateInitAndCompletedProcessDescriptor();

            WfCreateActivityParamCollection caps = PrepareTwoActivitiesCreateParams();

            caps.CreateActivities(processDesp, false);

            string targetKey = caps[0].CreatedDescriptor.Key;

            IWfActivityDescriptor matchedActDesp = caps.FindActivityByActivityDescription(processDesp, null, string.Format("{0}", targetKey));

            Assert.AreEqual(processDesp.InitialActivity.ToTransitions.FirstOrDefault().ToActivity.Key, matchedActDesp.Key);
        }
        /// <summary>
        /// 根据WfCreateActivityParamCollection的值创建节点,覆盖当前的流程
        /// </summary>
        /// <param name="capc"></param>
        /// <param name="overrideInitActivity"></param>
        public void CreateActivities(WfCreateActivityParamCollection capc, bool overrideInitActivity)
        {
            WfActivityDescriptor currentActDesp = (WfActivityDescriptor)this.InitialActivity;

            capc.CreateActivities(this, overrideInitActivity);
        }