public void BasicEditTransitionWithMainStreamExecutorTest() { IWfProcess process = WfProcessTestCommon.StartupSimpleProcess(); const string targetName = "修改后的名称"; IWfActivity targetActivity = process.Activities.FindActivityByDescriptorKey("NormalActivity"); IWfTransitionDescriptor targetDesp = process.Descriptor.InitialActivity.ToTransitions.GetTransitionByToActivity(targetActivity.Descriptor); targetDesp.Properties.SetValue("Name", targetName); WfEditTransitionPropertiesExecutor executor = new WfEditTransitionPropertiesExecutor(process.CurrentActivity, process, targetDesp, true); executor.Execute(); process = WfRuntime.GetProcessByProcessID(process.ID); targetActivity = process.Activities.FindActivityByDescriptorKey("NormalActivity"); targetDesp = process.Descriptor.InitialActivity.ToTransitions.GetTransitionByToActivity(targetActivity.Descriptor); Assert.AreEqual(targetName, targetDesp.Properties.GetValue("Name", string.Empty)); IWfActivityDescriptor msFromActDesp = process.MainStream.InitialActivity; IWfActivityDescriptor msToActDesp = process.MainStream.Activities["NormalActivity"]; targetDesp = msFromActDesp.ToTransitions.GetTransitionByToActivity(msToActDesp); Assert.IsNotNull(targetDesp); Assert.AreEqual(targetName, targetDesp.Properties.GetValue("Name", string.Empty)); }