Exemplo n.º 1
0
        public void MainStreamActivitiesWithAmountCondition()
        {
            IWfProcessDescriptor processDesp = WfProcessTestCommon.CreateSimpleProcessDescriptorWithCondition();

            IWfProcess process = WfProcessTestCommon.StartupProcess(processDesp);

            process.ApplicationRuntimeParameters["Amount"] = 2500;

            WfMainStreamActivityDescriptorCollection mainActs = process.GetMainStreamActivities(true);

            mainActs.Output("不经过领导的主线活动");

            Assert.IsTrue(mainActs.ContainsKey("NormalActivity"));
            Assert.IsFalse(mainActs.ContainsKey("ManagerActivity"));

            //改变条件
            process.ApplicationRuntimeParameters["Amount"] = 10000;

            mainActs = process.GetMainStreamActivities(true);

            mainActs.Output("经过领导的主线活动");

            Assert.IsTrue(mainActs.ContainsKey("NormalActivity"));
            Assert.IsTrue(mainActs.ContainsKey("ManagerActivity"));
        }
Exemplo n.º 2
0
        public static IWfProcess StartupSimpleProcessDescriptorWithTransitionCondition()
        {
            IWfProcessDescriptor processDesp = WfProcessTestCommon.CreateSimpleProcessDescriptorWithCondition();

            processDesp.InitialActivity.Resources.Add(new WfUserResourceDescriptor((IUser)OguObjectSettings.GetConfig().Objects["requestor"].Object));

            WfProcessStartupParams startupParams = GetInstanceOfWfProcessStartupParams(processDesp);

            return(WfRuntime.StartWorkflow(startupParams));
        }
Exemplo n.º 3
0
        public static IWfProcess StartupSimpleProcessDescriptorWithActivityCondition()
        {
            IWfProcessDescriptor processDesp = WfProcessTestCommon.CreateSimpleProcessDescriptorWithCondition();

            processDesp.InitialActivity.Resources.Add(new WfUserResourceDescriptor((IUser)OguObjectSettings.GetConfig().Objects["requestor"].Object));

            processDesp.Activities["NormalActivity"].Condition.Expression = "Amount >= 5000";

            WfProcessStartupParams startupParams = GetInstanceOfWfProcessStartupParams(processDesp);

            startupParams.DefaultTaskTitle = "测试流程节点带条件";

            return(WfRuntime.StartWorkflow(startupParams));
        }