public void DeleteActivityDescriptorWithTwoTransitionsTest()
        {
            //Init,Complete,Normal和Manager,其中Normal有出线到Manager和Completed
            IWfProcessDescriptor processDesp = WfProcessTestCommon.CreateSimpleProcessDescriptorWithCondition();

            IWfActivityDescriptor normalActDesp = processDesp.Activities["NormalActivity"];

            int originalActCount = processDesp.Activities.Count;

            normalActDesp.Delete();

            processDesp.Output();

            Assert.AreEqual(originalActCount - 1, processDesp.Activities.Count);
            Assert.AreEqual(2, processDesp.InitialActivity.ToTransitions.Count);
            Assert.AreEqual(2, processDesp.CompletedActivity.FromTransitions.Count);
            Assert.IsFalse(processDesp.InitialActivity.ToTransitions[0].Condition.IsEmpty);
            Assert.IsFalse(processDesp.InitialActivity.ToTransitions[1].Condition.IsEmpty);
        }
Exemple #2
0
        public void ConditionProcessSimulation()
        {
            IWfProcessDescriptor processDesp = WfProcessTestCommon.CreateSimpleProcessDescriptorWithCondition();

            WfSimulationParameters simulationParameters = new WfSimulationParameters();

            simulationParameters.Variables.Add(new WfVariableDescriptor("Amount", "10000", DataType.Int));

            WfSimulationResult result = WfSimulator.StartSimulation(processDesp, new WfSimulationParameters());

            Console.WriteLine(WfRuntime.ProcessContext.SimulationContext.GetOutputString());

            while (result.ProcessStatus != WfProcessStatus.Completed)
            {
                result = WfSimulator.MoveToSimulation(result.ProcessID, simulationParameters);

                Console.WriteLine(WfRuntime.ProcessContext.SimulationContext.GetOutputString());
            }
        }